@silurus/ooxml 0.78.0 → 0.79.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/README.md +39 -1
- package/THIRD_PARTY_NOTICES.md +13 -0
- package/dist/{canvas-viewer-mechanics-ChxLdOJg.js → canvas-viewer-mechanics-D9tsuHnG.js} +1 -1
- package/dist/chart-number-format-tjYUR9eS.js +435 -0
- package/dist/dash-Cyc-sevN.js +786 -0
- package/dist/{document-pull-client-xsdVDuVD.js → document-pull-client-YiU8M4LO.js} +3283 -3156
- package/dist/{docx-CZC3j4s4.js → docx-a1UpmRf8.js} +65 -56
- package/dist/docx.mjs +4 -4
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-HuZyTARz.js → line-distribute-pDqovJpT.js} +1 -1
- package/dist/{line-metrics-z9AdgPaZ.js → line-metrics-DjKxiIUD.js} +4097 -3184
- package/dist/math.mjs +1 -1
- package/dist/node.mjs +322 -322
- package/dist/{pptx-c3UgGKIs.js → pptx-t5ABdzfd.js} +192 -183
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/region-map.mjs +12708 -0
- package/dist/{render-yhFUeiYl.js → render-BjIEuFIG.js} +1 -1
- package/dist/render-worker-host-BB320snY.js +27 -0
- package/dist/render-worker-host-BjEPZBwf.js +27 -0
- package/dist/render-worker-host-hZ0o4OD7.js +27 -0
- package/dist/{resource-measurement-5g27Av6n.js → resource-measurement-D8EiTm_E.js} +1 -1
- package/dist/{session-BOuXp10X.js → session-Bhe_eY-s.js} +10 -10
- package/dist/{slide-pull-client-DKckZrLx.js → slide-pull-client-BQ8gJPTq.js} +626 -563
- package/dist/three-d.mjs +2158 -0
- package/dist/types/docx.d.ts +189 -16
- package/dist/types/index.d.ts +205 -20
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +166 -1
- package/dist/types/pptx.d.ts +191 -16
- package/dist/types/region-map.d.ts +520 -0
- package/dist/types/three-d.d.ts +520 -0
- package/dist/types/xlsx.d.ts +195 -16
- package/dist/{worksheet-pull-client-CMDRPZ5E.js → worksheet-pull-client-T0EzdEEQ.js} +13 -13
- package/dist/{xlsx-BAScjxlC.js → xlsx-CsDDMJIK.js} +833 -770
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +13 -1
- package/dist/render-worker-host-BzxTAscX.js +0 -27
- package/dist/render-worker-host-CBjWHxMb.js +0 -27
- package/dist/render-worker-host-Ivhx3KII.js +0 -27
- /package/dist/{highlight-rect-CAkCWJ37.js → highlight-rect-cCvVU-MW.js} +0 -0
- /package/dist/{mathjax-CMjda8Ip.js → mathjax-Dqo857oC.js} +0 -0
- /package/dist/{transfer-DCu4c2BL.js → transfer-3QEJrsJa.js} +0 -0
- /package/dist/{visible-index-CgyJLAS_.js → visible-index-CKvgpUrf.js} +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { $t as t, A as n, B as r, C as i, Ct as a, D as o, Dt as s, Et as c, It as l, J as u, Kt as d, Lt as f, M as p, O as m, Ot as h,
|
|
3
|
-
import { C as
|
|
4
|
-
import { a as
|
|
5
|
-
import { i as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { $t as t, A as n, B as r, C as i, Ct as a, D as o, Dt as s, Et as c, It as l, J as u, Kt as d, Lt as f, M as p, O as m, Ot as h, Qt as g, R as _, S as v, T as y, Tt as b, Ut as x, V as S, Xt as C, Yt as w, Zt as T, _ as E, _t as D, a as O, an as k, c as A, d as j, en as M, f as ee, g as te, gt as N, h as P, ht as F, in as I, it as L, j as R, kt as z, m as ne, mt as B, n as V, nn as H, on as re, p as ie, pt as U, q as ae, qt as oe, rn as se, s as ce, sn as le, tn as ue, u as de, vt as fe, w as pe, y as me, z as he } from "./line-metrics-DjKxiIUD.js";
|
|
3
|
+
import { C as W, E as G, S as K, T as ge, _ as _e, a as ve, b as ye, d as q, f as be, h as xe, i as Se, l as Ce, m as we, p as Te, t as Ee, u as De, v as Oe, w as ke, x as Ae, y as je } from "./canvas-viewer-mechanics-D9tsuHnG.js";
|
|
4
|
+
import { a as Me, i as Ne, t as Pe } from "./bounded-raw-part-cache-C6ro6Ezf.js";
|
|
5
|
+
import { a as Fe, i as Ie, o as Le } from "./chart-number-format-tjYUR9eS.js";
|
|
6
|
+
import { _ as Re, a as ze, g as J, h as Be } from "./dash-Cyc-sevN.js";
|
|
7
|
+
import { i as Ve } from "./resource-measurement-D8EiTm_E.js";
|
|
8
|
+
import { t as He } from "./mathjax-Dqo857oC.js";
|
|
9
|
+
import { n as Ue, r as We, t as Ge } from "./visible-index-CKvgpUrf.js";
|
|
10
|
+
import { a as Ke, c as qe, d as Je, i as Ye, l as Xe, n as Ze, o as Qe, s as $e, t as et, u as tt } from "./worksheet-pull-client-T0EzdEEQ.js";
|
|
9
11
|
//#region packages/core/src/sparkline/renderer.ts
|
|
10
|
-
function
|
|
12
|
+
function nt(e, t, n) {
|
|
11
13
|
let { values: r } = n;
|
|
12
14
|
if (r.length === 0 || t.w <= 0 || t.h <= 0) return;
|
|
13
15
|
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");
|
|
@@ -16,11 +18,11 @@ function tt(e, t, n) {
|
|
|
16
18
|
m === h && (h = m + 1, --m);
|
|
17
19
|
let g = h - m, _ = (e) => c + u - (e - m) / g * u;
|
|
18
20
|
if (n.kind === "stem") {
|
|
19
|
-
|
|
21
|
+
at(e, n, s, c, l, u);
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
24
|
if (n.kind === "column") {
|
|
23
|
-
|
|
25
|
+
it(e, n, r, s, c, l, u, m, h);
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
28
|
if (n.displayXAxis && m < 0 && h > 0) {
|
|
@@ -29,7 +31,7 @@ function tt(e, t, n) {
|
|
|
29
31
|
e.moveTo(s, t), e.lineTo(s + l, t), e.stroke(), e.restore();
|
|
30
32
|
}
|
|
31
33
|
let v = r.length, y = (e) => v === 1 ? s + l / 2 : s + e / (v - 1) * l;
|
|
32
|
-
e.save(), e.strokeStyle = i, e.lineCap = "round", e.lineJoin = "round", e.lineWidth = (n.lineWeight ?? .75) *
|
|
34
|
+
e.save(), e.strokeStyle = i, e.lineCap = "round", e.lineJoin = "round", e.lineWidth = (n.lineWeight ?? .75) * Re, e.beginPath();
|
|
33
35
|
let b = !1, x = n.displayEmptyCellsAs ?? "gap";
|
|
34
36
|
for (let t = 0; t < v; t++) {
|
|
35
37
|
let n = r[t];
|
|
@@ -44,7 +46,7 @@ function tt(e, t, n) {
|
|
|
44
46
|
b ? e.lineTo(i, a) : (e.moveTo(i, a), b = !0);
|
|
45
47
|
}
|
|
46
48
|
e.stroke(), e.restore();
|
|
47
|
-
let S = Math.max(1, Math.min(2.5, u * .12)), C =
|
|
49
|
+
let S = Math.max(1, Math.min(2.5, u * .12)), C = rt(r, n);
|
|
48
50
|
for (let t = 0; t < v; t++) {
|
|
49
51
|
let a = r[t];
|
|
50
52
|
if (a == null) continue;
|
|
@@ -52,7 +54,7 @@ function tt(e, t, n) {
|
|
|
52
54
|
(n.markers || o != null) && (e.save(), e.fillStyle = o ?? n.colorMarkers ?? i, e.beginPath(), e.arc(y(t), _(a), S, 0, Math.PI * 2), e.fill(), e.restore());
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
|
-
function
|
|
57
|
+
function rt(e, t) {
|
|
56
58
|
let n = e.map(() => null), r = e.map((e) => typeof e == "number" ? e : null), i = r.findIndex((e) => e != null), a = -1;
|
|
57
59
|
for (let e = r.length - 1; e >= 0; e--) if (r[e] != null) {
|
|
58
60
|
a = e;
|
|
@@ -67,10 +69,10 @@ function nt(e, t) {
|
|
|
67
69
|
if (t.low && t.colorLow && !Number.isNaN(c)) for (let e = 0; e < r.length; e++) r[e] === c && (n[e] = t.colorLow);
|
|
68
70
|
return n;
|
|
69
71
|
}
|
|
70
|
-
function
|
|
72
|
+
function it(e, t, n, r, i, a, o, s, c) {
|
|
71
73
|
let l = n.length;
|
|
72
74
|
if (l === 0) return;
|
|
73
|
-
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 =
|
|
75
|
+
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 = rt(n, t);
|
|
74
76
|
for (let i = 0; i < l; i++) {
|
|
75
77
|
let a = n[i];
|
|
76
78
|
if (a == null) continue;
|
|
@@ -78,10 +80,10 @@ function rt(e, t, n, r, i, a, o, s, c) {
|
|
|
78
80
|
e.save(), e.fillStyle = o, e.fillRect(c, Math.min(p, s), l, Math.abs(p - s)), e.restore();
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
function
|
|
83
|
+
function at(e, t, n, r, i, a) {
|
|
82
84
|
let o = t.values.length;
|
|
83
85
|
if (o === 0) return;
|
|
84
|
-
let s = r + a / 2, c = a / 2, l = i / o, u = Math.min(1.5, l * .15), d =
|
|
86
|
+
let s = r + a / 2, c = a / 2, l = i / o, u = Math.min(1.5, l * .15), d = rt(t.values, t);
|
|
85
87
|
for (let r = 0; r < o; r++) {
|
|
86
88
|
let i = t.values[r];
|
|
87
89
|
if (i == null || i === 0) continue;
|
|
@@ -91,16 +93,16 @@ function it(e, t, n, r, i, a) {
|
|
|
91
93
|
}
|
|
92
94
|
//#endregion
|
|
93
95
|
//#region packages/core/src/text/bidi/segments.ts
|
|
94
|
-
function
|
|
96
|
+
function ot(e, t) {
|
|
95
97
|
return e === !0 ? "rtl" : e === !1 ? "ltr" : p().computeLevels(t, "auto").paragraphLevel === 1 ? "rtl" : "ltr";
|
|
96
98
|
}
|
|
97
99
|
//#endregion
|
|
98
100
|
//#region packages/xlsx/src/worker.ts?worker&inline
|
|
99
|
-
var ot = "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();_.__wbg_xlsxarchive_free(e,0)}acknowledge_sheet_cursor_terminal(){let e=_.xlsxarchive_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);if(e[1])throw f(e[0])}assert_healthy(){let e=_.xlsxarchive_assert_healthy(this.__wbg_ptr);if(e[1])throw f(e[0])}cancel_sheet_cursor(){_.xlsxarchive_cancel_sheet_cursor(this.__wbg_ptr)}close_sheet_cursor(){_.xlsxarchive_close_sheet_cursor(this.__wbg_ptr)}extract_image(e){let t=d(e,_.__wbindgen_malloc,_.__wbindgen_realloc),n=g,i=_.xlsxarchive_extract_image(this.__wbg_ptr,t,n);if(i[3])throw f(i[2]);var a=r(i[0],i[1]).slice();return _.__wbindgen_free(i[0],i[1]*1,1),a}constructor(e,t,r,i){let a=u(e,_.__wbindgen_malloc),o=g,s=_.xlsxarchive_new(a,o,!l(t),l(t)?BigInt(0):t,!l(r),l(r)?BigInt(0):r,!l(i),l(i)?BigInt(0):i);if(s[2])throw f(s[1]);return this.__wbg_ptr=s[0]>>>0,n.register(this,this.__wbg_ptr,this),this}open_sheet_cursor(e,t){let n=d(t,_.__wbindgen_malloc,_.__wbindgen_realloc),r=g,i=_.xlsxarchive_open_sheet_cursor(this.__wbg_ptr,e,n,r);if(i[1])throw f(i[0])}parse(){let e=_.xlsxarchive_parse(this.__wbg_ptr);if(e[3])throw f(e[2]);var t=r(e[0],e[1]).slice();return _.__wbindgen_free(e[0],e[1]*1,1),t}pull_sheet_cursor(e){let t=_.xlsxarchive_pull_sheet_cursor(this.__wbg_ptr,e);if(t[3])throw f(t[2]);var n=r(t[0],t[1]).slice();return _.__wbindgen_free(t[0],t[1]*1,1),n}resource_usage(){let e=_.xlsxarchive_resource_usage(this.__wbg_ptr);if(e[3])throw f(e[2]);var t=r(e[0],e[1]).slice();return _.__wbindgen_free(e[0],e[1]*1,1),t}sheet_cursor_pull_finished(){return _.xlsxarchive_sheet_cursor_pull_finished(this.__wbg_ptr)!==0}sheet_cursor_resource_usage(){let e=_.xlsxarchive_sheet_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw f(e[2]);var t=r(e[0],e[1]).slice();return _.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=_.xlsxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,f(i[2]);return e=n,t=r,o(n,r)}finally{_.__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_throw_6b64449b9b9ed33c:function(e,t){throw Error(o(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(o(e,t))}finally{_.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=d(n,_.__wbindgen_malloc,_.__wbindgen_realloc),i=g;a().setInt32(e+4,i,!0),a().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return o(e,t)},__wbindgen_init_externref_table:function(){let e=_.__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=>_.__wbg_xlsxarchive_free(e>>>0,1));function r(e,t){return e>>>=0,c().subarray(e/1,e/1+t)}let i=null;function a(){return(i===null||i.buffer.detached===!0||i.buffer.detached===void 0&&i.buffer!==_.memory.buffer)&&(i=new DataView(_.memory.buffer)),i}function o(e,t){return e>>>=0,ee(e,t)}let s=null;function c(){return(s===null||s.byteLength===0)&&(s=new Uint8Array(_.memory.buffer)),s}function l(e){return e==null}function u(e,t){let n=t(e.length*1,1)>>>0;return c().set(e,n/1),g=e.length,n}function d(e,t,n){if(n===void 0){let n=h.encode(e),r=t(n.length,1)>>>0;return c().subarray(r,r+n.length).set(n),g=n.length,r}let r=e.length,i=t(r,1)>>>0,a=c(),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=c().subarray(i+o,i+r),a=h.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return g=o,i}function f(e){let t=_.__wbindgen_externrefs.get(e);return _.__externref_table_dealloc(e),t}let p=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});p.decode();let m=0;function ee(e,t){return m+=t,m>=2146435072&&(p=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),p.decode(),m=t),p.decode(c().subarray(e,e+t))}const h=new TextEncoder;`encodeInto`in h||(h.encodeInto=function(e,t){let n=h.encode(e);return t.set(n),{read:e.length,written:n.length}});let g=0,_;function v(e,t){return _=e.exports,i=null,s=null,_.__wbindgen_start(),_}async function te(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 y(e){if(_!==void 0)return _;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 te(await e,n);return v(r,i)}async function ne(e){return _=void 0,i=null,s=null,y(e)}var b=class e extends Error{code;constructor(t,n){super(n),this.name=`OoxmlError`,this.code=t,Object.setPrototypeOf(this,e.prototype)}},x=class e extends Error{code=`ooxml-resource-limit`;details;constructor(t,n){super(t),this.name=`OoxmlResourceLimitError`;let r=n.violation,i=Object.freeze({format:r.format,operation:r.operation,resource:r.resource,metric:r.metric,...r.part===void 0?{}:{part:r.part},limit:r.limit,observed:r.observed,configurable:r.configurable,usage:Object.freeze({archiveEntryCount:r.usage.archiveEntryCount,declaredInflatedBytes:r.usage.declaredInflatedBytes,...r.usage.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:r.usage.largestInflatedEntryBytes},distinctInflatedBytes:r.usage.distinctInflatedBytes,operationInflatedBytes:r.usage.operationInflatedBytes})});this.details=Object.freeze({stage:n.stage,violation:i}),Object.setPrototypeOf(this,e.prototype)}},re=class e extends RangeError{code=`ooxml-decoded-image-limit`;constructor(t,n,r){super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`),this.metric=t,this.limit=n,this.observed=r,this.name=`OoxmlDecodedImageLimitError`,Object.setPrototypeOf(this,e.prototype)}};function ie(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 ae=class{state=`uninitialized`;generationValue=0;readiness;poisonListeners=new Set;constructor(e,t,n){this.initialize=e,this.reinitialize=t,this.normalizeFailure=n}get generation(){return this.generationValue}get poisoned(){return this.state===`poisoned`}onPoison(e){return this.poisonListeners.add(e),()=>this.poisonListeners.delete(e)}async ensureReady(){if(this.state!==`ready`){if(!this.readiness){let e=this.state===`uninitialized`?this.initialize:this.reinitialize;this.readiness=Promise.resolve().then(e).then(()=>{this.generationValue+=1,this.state=`ready`,this.readiness=void 0},e=>{throw this.readiness=void 0,e})}await this.readiness}}run(e){try{return e()}catch(e){let t=this.normalizeFailure(e);throw t?(this.poison(t),t):e}}tryRunReady(e){if(this.state!==`ready`)return{current:!1};let t=this.generationValue,n=this.run(e);return this.state!==`ready`||t!==this.generationValue?{current:!1}:{current:!0,generation:t,value:n}}poison(e){this.state=`poisoned`,this.readiness=void 0;for(let t of this.poisonListeners)t(e)}assertCurrent(e){if(this.state!==`ready`||e!==this.generationValue)throw Error(`WASM archive session belongs to a discarded runtime generation`)}},S=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function oe(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function se(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}function C(e,t){return e({module_or_path:t})}var ce=class{runtime;wasmInput=null;currentArchive=null;constructor(e,t={}){this.init=e,this.options=t,this.runtime=new ae(()=>this.invokeConfigured(this.init),()=>this.invokeConfigured(this.options.reinit??this.init),le),this.runtime.onPoison(()=>this.dropPoisonedArchive())}setWasmInput(e){this.wasmInput=e,this.runtime.ensureReady().catch(()=>void 0)}setWasmUrl(e){this.setWasmInput(e)}get archive(){return this.currentArchive}setArchive(e){this.freeArchive(),this.currentArchive=e}disposeArchive(){this.freeArchive()}get poisoned(){return this.runtime.poisoned}async ensureReady(){await this.runtime.ensureReady()}run(e){return this.runtime.run(e)}poison(){this.runtime.poison(new S(`WASM parser was recycled`))}invokeConfigured(e){return this.wasmInput===null?Promise.reject(Error(`WasmParserHost: setWasmInput was never called`)):C(e,this.wasmInput)}freeArchive(){this.currentArchive!==null&&this.options.freeArchive&&this.options.freeArchive(this.currentArchive),this.currentArchive=null}dropPoisonedArchive(){let e=this.currentArchive;this.currentArchive=null,se(e)}};function le(e){return oe(e)?new S(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`):null}function w(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function ue(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return w(t.requiredBytes)&&w(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var T=class e extends RangeError{code=`ooxml-insufficient-credit`;requiredBytes;offeredBytes;constructor(t){super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`),this.name=`PullSessionInsufficientCreditError`,this.requiredBytes=t.requiredBytes,this.offeredBytes=t.offeredBytes,Object.setPrototypeOf(this,e.prototype)}};function de(e){if(e instanceof T)return e;let t=e instanceof Error?e.message:String(e);if(!t.startsWith(`OOXML_INSUFFICIENT_CREDIT:`))return;let n;try{n=JSON.parse(t.slice(26))}catch{return}if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n;if(!(r.code!==`ooxml-insufficient-credit`||!ue(r)))return new T(r)}const E=`OOXML_RESOURCE_LIMIT:`;function D(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function O(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return D(t.archiveEntryCount)&&D(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||D(t.largestInflatedEntryBytes))&&D(t.distinctInflatedBytes)&&D(t.operationInflatedBytes)}function k(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{throw TypeError(`OOXML resource usage checkpoint is not valid JSON`)}if(!O(t))throw TypeError(`OOXML resource usage checkpoint is invalid`);return t}function fe(e){return e===`docx`||e===`xlsx`||e===`pptx`}function pe(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function A(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function j(e){return A(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function me(e){return!A(e,4096)||e.startsWith(`/`)||e.startsWith(`\\\\`)||e.includes(`\\\\`)||e.includes(`?`)||e.includes(`#`)||e.includes(`://`)||/^[a-z]:/iu.test(e)?!1:e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}const M=new Map([[`archive-entry:declared-inflated-bytes`,{stage:`container`,part:`required`}],[`archive-entry:actual-inflated-bytes`,{stage:`decompression`,part:`required`}],[`archive:entry-count`,{stage:`container`,part:`forbidden`}],[`archive:central-directory-bytes`,{stage:`container`,part:`forbidden`,configurable:!1}],[`archive:distinct-inflated-bytes`,{stage:`decompression`,part:`required`}],[`xml-event:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-context:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-tree:depth`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-row:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-shell:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}]]),he=new Set([...M.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),ge=new Set([...M.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function _e(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!fe(t.format)||!A(t.operation,256)||!j(t.resource)||!j(t.metric)||!D(t.limit)||!D(t.observed)||typeof t.configurable!=`boolean`||!O(t.usage)?!1:!(`part`in t)||me(t.part)}function N(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!pe(t.stage)||!_e(t.violation))return!1;let n=t.violation,r=M.get(`${n.resource}:${n.metric}`);return r?t.stage!==r.stage||r.configurable===!1&&n.configurable!==!1?!1:r.part===`required`?n.part!==void 0:r.part===`forbidden`?n.part===void 0:!0:!(he.has(n.resource)&&ge.has(n.metric))}function P(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function F(e){if(!N(e))return;let t=e.violation,n={stage:e.stage,violation:{format:t.format,operation:t.operation,resource:t.resource,metric:t.metric,...t.part===void 0?{}:{part:t.part},limit:t.limit,observed:t.observed,configurable:t.configurable,usage:P(t.usage)}};return N(n)?n:void 0}function I(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``}: ${t.metric} ${t.observed} > ${t.limit}`}function ve(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(E))return;let n;try{n=JSON.parse(t.slice(21))}catch{return}if(!n||typeof n!=`object`)return;let r=n;if(!(r.code!==`ooxml-resource-limit`||!N(r.details)))return new x(I(r.details),r.details)}function ye(e){if(e instanceof re)return{message:e.message,errorName:e.name,code:e.code,decodedImage:{metric:e.metric,limit:e.limit,observed:e.observed}};let t=de(e);if(t)return{message:t.message,errorName:t.name,code:t.code,insufficientCredit:{requiredBytes:t.requiredBytes,offeredBytes:t.offeredBytes}};let n=e instanceof b||e instanceof x?e:ve(e);if(n instanceof x){let e=F(n.details);return e?{message:typeof n.message==`string`?n.message:I(e),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:e}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(n instanceof b)return{message:typeof n.message==`string`?n.message:String(n.message),errorName:A(n.name,128)?n.name:`OoxmlError`,...j(n.code)?{code:n.code}:{}};let r=e instanceof Error?e.message:String(e);if(typeof r==`string`&&r.startsWith(E))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let i=e instanceof Error?e:Error(r),a=i;return{message:typeof i.message==`string`?i.message:String(i.message),errorName:A(i.name,128)?i.name:`Error`,...typeof a.code==`string`?{code:a.code}:{}}}function L(e){try{return ye(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}function be(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer instanceof ArrayBuffer?e.buffer:e.slice().buffer}Object.freeze({maxArchiveEntryBytes:134217728,maxTotalInflatedBytes:268435456,maxArchiveEntries:4096});function xe(e){return[e.maxArchiveEntryBytes===null?0n:BigInt(e.maxArchiveEntryBytes),e.maxTotalInflatedBytes===null?0n:BigInt(e.maxTotalInflatedBytes),e.maxArchiveEntries===null?0n:BigInt(e.maxArchiveEntries)]}const R=`ooxml-pull-v1`;function z(e,t){if(!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} must be a positive safe integer`)}function Se(e){if(!(typeof e==`string`&&e.length>0||typeof e==`number`&&Number.isSafeInteger(e)&&e>0))throw RangeError(`session id must be a non-empty string or positive safe integer`)}var Ce=class{owner;queue=Promise.resolve();leases=new Map;retainedBytes=0;retainedCount=0;maxRetainedBytes;maxRetainedCount;cleanups=new Set;pendingFatalCleanups=[];poisonRunning=!1;fatal;constructor(e){this.maxRetainedBytes=e?.maxRetainedBytes??64*1024*1024,this.maxRetainedCount=e?.maxRetainedCount??256,z(this.maxRetainedBytes,`max retained lease bytes`),z(this.maxRetainedCount,`max retained lease count`)}enqueue(e){let t=this.queue.then(e,e);return this.queue=t.then(()=>void 0,()=>void 0),t}acquire(e){return this.owner===void 0?(this.owner=e,!0):this.owner===e}release(e){this.owner===e&&(this.owner=void 0)}retainLease(e,t,n){if(!Number.isSafeInteger(n)||n<0)throw RangeError(`retained lease bytes are invalid`);let r=this.leases.get(e)??new Map;if(r.has(t))throw Error(`driver returned a duplicate lease id`);if(this.retainedCount+1>this.maxRetainedCount)throw RangeError(`retained lease count exceeds limit`);if(this.retainedBytes+n>this.maxRetainedBytes)throw RangeError(`retained lease bytes exceed limit`);r.set(t,n),this.leases.set(e,r),this.retainedCount++,this.retainedBytes+=n}releaseLease(e,t){let n=this.leases.get(e),r=n?.get(t);r!==void 0&&(n?.delete(t),n?.size===0&&this.leases.delete(e),this.retainedCount--,this.retainedBytes-=r)}registerCleanup(e){return this.fatal?(this.poisonRunning?this.pendingFatalCleanups.push(e):this.enqueue(e).catch(()=>void 0),()=>void 0):(this.cleanups.add(e),()=>this.cleanups.delete(e))}get fatalError(){return this.fatal}get registeredHostCount(){return this.cleanups.size}async poison(e){if(this.fatal??=e,this.poisonRunning)return this.fatal;this.poisonRunning=!0,this.pendingFatalCleanups.push(...this.cleanups);try{let e;for(;(e=this.pendingFatalCleanups.shift())!==void 0;)await e().catch(()=>void 0)}finally{this.poisonRunning=!1}return this.fatal}},we=class{options;coordinator;coordinatorOwner=Symbol(`pull-session-host`);unregisterCleanup;sequence=0;unacked;leases=new Map;activeDriverLeases=new Set;nextWireLeaseId;cancelRequested=!1;cancelComplete=!1;closeRequested=!1;closeComplete=!1;driverCancelComplete=!1;driverCloseComplete=!1;completed=!1;constructor(e){Se(e.sessionId),z(e.operationId,`operation id`),z(e.generation,`generation`),z(e.maxByteCredit,`max byte credit`),e.wireLeaseIdStart!==void 0&&z(e.wireLeaseIdStart,`wire lease id start`),this.options=e,this.coordinator=e.coordinator,this.nextWireLeaseId=e.wireLeaseIdStart??1,this.unregisterCleanup=this.coordinator.registerCleanup(()=>this.forceFatalCleanup())}dispatch(e,t){return this.coordinator.enqueue(async()=>{let n=await this.execute(e);try{t(n.response,n.transfer)}catch(e){throw await this.rollbackFailedPost(n),e}})}async rollbackFailedPost(e){let t=e.response;if(t.kind===`chunk`){let n=t.leaseId===void 0?void 0:this.leases.get(t.leaseId);try{await this.options.driver.disposeInvalidChunk?.({payload:t.payload,byteLength:t.byteLength,done:t.done,leaseId:n?.driverLeaseId,retainedBytes:n?.retainedBytes,transfer:e.transfer})}catch{}}this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);for(let[e,t]of[...this.leases])try{await this.options.driver.releaseLease?.(t.driverLeaseId)}catch{}finally{this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e)}if(this.cancelRequested=!0,!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch{}this.unregisterCleanup()}async execute(e){try{if(this.isStaleLifecycle(e)){let t=e.kind===`cancel`?`cancel`:`close`;return this.sameOperationIdentity(e)?{response:this.accepted(e,t,!0)}:{response:this.errorResponse(e,{message:`stale lifecycle targets another session or operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`})}}this.validateCommandIdentity(e);let t=this.coordinator.fatalError;if(t)return e.kind===`pull`?{response:this.errorResponse(e,t)}:(e.kind===`cancel`?await this.cancel():e.kind===`close`?await this.close():e.kind===`release`&&await this.release(e.leaseId),{response:this.accepted(e,e.kind)});switch(e.kind){case`pull`:return await this.pull(e);case`ack`:return await this.ack(e.sequence),{response:this.accepted(e,`ack`)};case`release`:return await this.release(e.leaseId),{response:this.accepted(e,`release`)};case`cancel`:return await this.cancel(),{response:this.accepted(e,`cancel`)};case`close`:return await this.close(),{response:this.accepted(e,`close`)}}}catch(t){let n=L(t);return n.code===`ooxml-resource-limit`&&(n=await this.coordinator.poison(n)),{response:this.errorResponse(e,n)}}}async pull(e){if(this.closeRequested||this.cancelRequested||this.completed)throw Error(`pull session is closed`);if(this.unacked)throw Error(`previous chunk is not acknowledged`);if(!Number.isSafeInteger(e.sequence)||e.sequence<0||e.sequence!==this.sequence)throw Error(`pull command sequence mismatch`);if(this.validateHostCredit(e.byteCredit),!this.coordinator.acquire(this.coordinatorOwner))throw Error(`another operation has an unacknowledged package chunk`);let t;try{t=await this.options.driver.pull(e.byteCredit)}catch(e){throw this.coordinator.release(this.coordinatorOwner),e}let n=!1,r=!1,i,a;try{let o=this.options.driver.measureChunk(t),s=this.arrayBufferTransferBytes(t.transfer);if(o<s)throw RangeError(`measured chunk bytes are below ArrayBuffer transfer bytes`);if(a=Math.max(o,s),t.leaseId!==void 0){if(z(t.leaseId,`lease id`),t.retainedBytes===void 0)throw Error(`retained lease bytes are required`);if(this.activeDriverLeases.has(t.leaseId))throw r=!0,Error(`driver returned an active duplicate lease id`);i=this.allocateWireLeaseId(),this.coordinator.retainLease(this.coordinatorOwner,i,t.retainedBytes),this.leases.set(i,{driverLeaseId:t.leaseId,retainedBytes:t.retainedBytes}),this.activeDriverLeases.add(t.leaseId),n=!0}else if(t.retainedBytes!==void 0)throw Error(`retained lease bytes require a lease id`);if(!Number.isSafeInteger(a)||a<0)throw RangeError(`host chunk byte length must be a non-negative safe integer`);if(a>e.byteCredit)throw RangeError(`host chunk exceeds byte credit`)}catch(e){let a;try{await this.options.driver.disposeInvalidChunk?.(t)}catch(e){a=e}if(n&&i!==void 0)try{await this.release(i)}catch(e){a??=e}else if(t.leaseId!==void 0&&!r)try{await this.options.driver.releaseLease?.(t.leaseId)}catch(e){a??=e}if(r)try{await this.cancel()}catch(e){a??=e}throw this.coordinator.release(this.coordinatorOwner),a||e}return this.unacked={sequence:this.sequence,done:t.done},{response:{kind:`chunk`,protocol:R,...this.identity(),requestId:e.requestId,sequence:this.sequence,byteLength:a,done:t.done,payload:t.payload,leaseId:i,usage:this.resourceUsage()},transfer:t.transfer}}async ack(e){if(!Number.isSafeInteger(e)||e<0)throw RangeError(`invalid ack sequence`);if(e<this.sequence)return;if(!this.unacked||e!==this.sequence)throw Error(`ack sequence mismatch`);let t=this.unacked.done;await this.options.driver.acknowledge?.(e),this.unacked=void 0,this.coordinator.release(this.coordinatorOwner),this.sequence++,t&&(this.completed=!0,this.maybeUnregisterCompleted())}async release(e){z(e,`wire lease id`);let t=this.leases.get(e);t&&(await this.options.driver.releaseLease?.(t.driverLeaseId),this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e),this.maybeUnregisterCompleted())}async cancel(){if(this.cancelComplete)return;this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.cancelComplete=!0,this.unregisterCleanup()}async close(){if(this.closeComplete)return;this.closeRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCloseComplete)try{await this.options.driver.close?.(),this.driverCloseComplete=!0}catch(t){e??=t}if(e)throw e;this.closeComplete=!0,this.unregisterCleanup()}async releaseAllLeases(){let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(e)throw e}validateCommandIdentity(e){if(e.protocol!==`ooxml-pull-v1`||e.sessionId!==this.options.sessionId||e.operationId!==this.options.operationId||e.generation!==this.options.generation||!Number.isSafeInteger(e.requestId)||e.requestId<=0)throw Error(`stale or mismatched pull session command`)}validateHostCredit(e){if(z(e,`byte credit`),e>this.options.maxByteCredit)throw RangeError(`byte credit exceeds host maximum`)}accepted(e,t,n=!1){return{kind:`accepted`,protocol:R,...n?{sessionId:e.sessionId,operationId:e.operationId,generation:e.generation}:this.identity(),requestId:e.requestId,command:t,usage:this.resourceUsage()}}identity(){return{sessionId:this.options.sessionId,operationId:this.options.operationId,generation:this.options.generation}}isStaleLifecycle(e){return(e.kind===`cancel`||e.kind===`close`)&&e.protocol===`ooxml-pull-v1`&&Number.isSafeInteger(e.requestId)&&e.requestId>0&&Number.isSafeInteger(e.generation)&&e.generation>0&&e.generation<this.options.generation}sameOperationIdentity(e){return e.sessionId===this.options.sessionId&&e.operationId===this.options.operationId}errorResponse(e,t){return{kind:`error`,protocol:R,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:t,usage:this.errorResourceUsage()}}async forceFatalCleanup(){this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.unregisterCleanup()}allocateWireLeaseId(){if(!Number.isSafeInteger(this.nextWireLeaseId)||this.nextWireLeaseId<=0)throw RangeError(`wire lease id space exhausted`);return this.nextWireLeaseId++}arrayBufferTransferBytes(e){let t=0;for(let n of e??[])if(n instanceof ArrayBuffer&&(t+=n.byteLength,!Number.isSafeInteger(t)))throw RangeError(`ArrayBuffer transfer bytes overflow`);return t}maybeUnregisterCompleted(){this.completed&&this.leases.size===0&&this.unregisterCleanup()}resourceUsage(){return this.options.driver.resourceUsage?.()}errorResourceUsage(){try{return this.resourceUsage()}catch{return}}};function Te(e,t){for(let n of e)for(let e of n.cells){let n=e.value;if(n.type===`shared`){let r=t[n.si];if(r){let t={type:`text`,text:r.text};r.runs!==void 0&&(t.runs=r.runs),r.phoneticRuns!==void 0&&(t.phoneticRuns=r.phoneticRuns),r.phoneticPr!==void 0&&(t.phoneticPr=r.phoneticPr),e.value=t}else e.value={type:`text`,text:``}}}return e}function Ee(e,t,n,r){let i=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=JSON.parse(new TextDecoder().decode(i));if(!a||typeof a!=`object`||!(`kind`in a))throw Error(`worksheet cursor returned an invalid unit`);let o=a;if(t!==(o.kind===`finished`))throw Error(`worksheet cursor terminal marker mismatch`);if(o.kind===`rows`){if(!Array.isArray(o.rows))throw Error(`worksheet row unit is missing rows`);return n&&Te(o.rows,n),r?.(o.rows),{kind:`rows`,rows:o.rows}}if(o.kind===`finished`){if(!o.worksheet||typeof o.worksheet!=`object`)throw Error(`worksheet terminal unit is missing its worksheet`);return o.worksheet.rows=[],{kind:`finished`,worksheet:o.worksheet}}throw Error(`worksheet cursor returned an unknown unit kind`)}function B(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function V(e,t,n){return B(e,`resource measurement`),B(t,`resource measurement`),B(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function H(e,t=2**53-1){B(t,`resource measurement limit`);let n=0;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=3}else a=3;if(n=V(n,a,t),n>t)return n}return n}function U(e,t=2**53-1){B(t,`resource measurement limit`);let n=V(0,2,t);if(n>t)return n;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i===34||i===92||i===8||i===9||i===10||i===12||i===13)a=2;else if(i<=31)a=6;else if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=6}else a=i>=55296&&i<=57343?6:3;if(n=V(n,a,t),n>t)return n}return n}function W(e,t){return V(0,e,t)}function G(e,t=2**53-1,n=!1){if(B(t,`resource measurement limit`),e===null)return{jsonBytes:W(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:U(e,t),stringValueUtf8Bytes:H(e,t)};if(typeof e==`boolean`)return{jsonBytes:W(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:W((Number.isFinite(e)?String(Object.is(e,-0)?0:e):`null`).length,t),stringValueUtf8Bytes:0};if(typeof e==`bigint`)throw TypeError(`BigInt values cannot be serialized to JSON`);if(Array.isArray(e)){let n=W(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=V(n,1,t));let a=G(e[i],t,!0);n=V(n,a.jsonBytes,t),r=V(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=W(2,t),r=0,i=0;for(let[a,o]of Object.entries(e)){if(o===void 0||typeof o==`function`||typeof o==`symbol`)continue;i++!==0&&(n=V(n,1,t)),n=V(n,U(a,t),t),n=V(n,1,t);let e=G(o,t);n=V(n,e.jsonBytes,t),r=V(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?W(4,t):0,stringValueUtf8Bytes:0}}const K=1e5,q=25e4,J=33554432,Y=67108864,De=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function Oe(e){let t=e.reduce((e,t)=>V(e,t.cells.length,q),0);return{rows:e.length,cells:t,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=G(t.value,J).stringValueUtf8Bytes;return V(e,V(n,t.formula===void 0?0:H(t.formula,J),J),J)},e),0)}}function ke(e,t){let n=G(e,67108864);return{...t,jsonBytes:n.jsonBytes}}function Ae(e,t){return{rows:V(e.rows,t.rows,K),cells:V(e.cells,t.cells,q),ownedUtf8Bytes:V(e.ownedUtf8Bytes,t.ownedUtf8Bytes,J)}}function X(e,t,n,r,i,a,o){let s=n===`worksheet-json`?`serialization`:`parsing`;return new x(`OOXML resource limit exceeded${t?` for ${t}`:``}: ${r} ${a} > ${i}`,{stage:s,violation:{format:`xlsx`,operation:e,resource:n,metric:r,...t===void 0?{}:{part:t},limit:i,observed:Math.min(a,i+1),configurable:!1,usage:o??De}})}function Z(e,t,n,r){let i=[[`rows`,e.rows,K],[`cells`,e.cells,q],[`owned-utf8-bytes`,e.ownedUtf8Bytes,J]];for(let[e,a,o]of i)if(a>o)throw X(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,o,a,r)}function je(e,t,n,r){if(e>Y)throw X(t,n,`worksheet-json`,`bytes`,Y,e,r)}var Me=class{coordinator=new Ce;sessions=new Map;operationTail=Promise.resolve();pendingOpens=new Map;resourceFailure;constructor(e,t,n=e=>e(this.requireArchive()),r){this.archive=e,this.acceptWorksheet=t,this.executeArchive=n,this.prepareRows=r}reserveOpen(e){this.pendingOpens.set(e.sessionId,{identity:e,canceled:!1})}abandonOpen(e){this.pendingOpens.delete(e)}get pendingOpenCount(){return this.pendingOpens.size}async open(e,t,n){if(this.resourceFailure)throw this.resourceFailure;let r=this.pendingOpens.get(n.sessionId);if(!r||r.identity.operationId!==n.operationId||r.identity.generation!==n.generation)throw Error(`worksheet pull session open reservation is stale or missing`);let i,a=new Promise(e=>{i=e}),o=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(r.canceled)throw Error(`worksheet pull session open was canceled`);this.executeArchive(n=>n.open_sheet_cursor(e,t));let a=[],o={rows:0,cells:0,ownedUtf8Bytes:0},s,c=!1,l=new we({...n,maxByteCredit:67108864,coordinator:this.coordinator,driver:{pull:()=>{let e=this.executeArchive(e=>e.pull_sheet_cursor(128)),t=this.executeArchive(e=>e.sheet_cursor_pull_finished());if(this.acceptWorksheet){let n=Ee(e,t,void 0,this.prepareRows);try{if(n.kind===`rows`){let e=Ae(o,Oe(n.rows));Z(e,`get-worksheet-worker`,void 0,this.readResourceUsage()),a.push(...n.rows),o=e}else s=n.worksheet}catch(e){throw e instanceof x&&(this.resourceFailure??=e),e}}c=t;let n=be(e);return{payload:n,byteLength:n.byteLength,done:t,transfer:[n]}},measureChunk:({payload:e})=>e.byteLength,acknowledge:()=>{if(!c)return;let t,r;try{if(this.acceptWorksheet){if(!s)throw Error(`worksheet terminal payload is missing`);s.rows=s.parseError?[]:a;let n=s.parseError?{rows:0,cells:0,ownedUtf8Bytes:0}:o,i=ke(s,n),c=this.readResourceUsage();Z(i,`get-worksheet-worker`,void 0,c),je(i.jsonBytes,`get-worksheet-worker`,void 0,c);let l=this.acceptWorksheet(e,s,i,c);typeof l==`function`?t=l:l&&({rollback:t,commit:r}=l)}this.executeArchive(e=>e.acknowledge_sheet_cursor_terminal()),r?.()}catch(e){throw t?.(),e instanceof x&&(this.resourceFailure??=e),e}c=!1,this.sessions.delete(n.sessionId),i()},cancel:()=>{try{this.archive()&&this.executeArchive(e=>e.cancel_sheet_cursor())}finally{this.sessions.delete(n.sessionId),i()}},close:()=>{try{this.archive()&&this.executeArchive(e=>e.close_sheet_cursor())}finally{this.sessions.delete(n.sessionId),i()}},resourceUsage:()=>this.readResourceUsage()}});this.sessions.set(n.sessionId,{host:l,identity:n}),this.pendingOpens.delete(n.sessionId)}));this.operationTail=o.then(()=>a,()=>void 0);try{await o}catch(e){throw this.pendingOpens.delete(n.sessionId),i(),e}}async postOpenedSafely(e,t,n){try{t()}catch(t){await this.closeIdentity(e);try{n(t)}catch{}}}dispatch(e,t){let n=this.sessions.get(e.sessionId);if(n)return n.host.dispatch(e,t);let r=this.pendingOpens.get(e.sessionId);if(r&&(e.kind===`cancel`||e.kind===`close`)){let n=r.identity.operationId===e.operationId&&r.identity.generation===e.generation;return n&&(r.canceled=!0),t(n?{protocol:R,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}:{protocol:R,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:{message:`stale lifecycle targets another pending worksheet operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`}}),Promise.resolve()}return e.kind===`cancel`||e.kind===`close`?(t({protocol:R,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}),Promise.resolve()):(t({protocol:R,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:L(Error(`worksheet pull session is not open`))}),Promise.resolve())}async dispatchSafely(e,t){try{await this.dispatch(e,t)}catch(n){try{t({protocol:R,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:L(n)})}catch{}}}run(e){let t=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(this.resourceFailure)throw this.resourceFailure;return e()})).catch(e=>{throw e instanceof x&&(this.resourceFailure??=e),e});return this.operationTail=t.then(()=>void 0,()=>void 0),t}async reset(){for(let e of this.pendingOpens.values())e.canceled=!0;let e=1;for(let{host:t,identity:n}of[...this.sessions.values()])await t.dispatch({protocol:R,kind:`close`,...n,requestId:e++},()=>void 0);this.sessions.clear(),await this.operationTail,this.pendingOpens.clear(),this.resourceFailure=void 0}requireArchive(){let e=this.archive();if(!e)throw Error(`Workbook not loaded`);return e}async closeIdentity(e){let t=this.sessions.get(e.sessionId);if(t){await t.host.dispatch({protocol:R,kind:`close`,...e,requestId:1},()=>void 0);return}let n=this.pendingOpens.get(e.sessionId);n&&n.identity.operationId===e.operationId&&n.identity.generation===e.generation&&(n.canceled=!0)}readResourceUsage(){try{return k(this.executeArchive(e=>e.sheet_cursor_resource_usage()))}catch(e){if(String(e).includes(`worksheet cursor usage is unavailable`))return;throw e}}};function Ne(e){return!!e&&typeof e==`object`&&e.protocol===`ooxml-pull-v1`}const Q=new ce(y,{freeArchive:e=>e.free(),reinit:ne}),$=new Me(()=>Q.archive,void 0,e=>{let t=Q.archive;if(!t)throw Error(`Workbook not loaded`);return Q.run(()=>e(t))});self.onmessage=async t=>{let n=t.data;if(Ne(n)){await $.dispatchSafely(n,(e,t)=>self.postMessage(e,t));return}if(n.type===`init`){Q.setWasmInput(ie(n.wasmUrl)??n.wasmUrl);return}let r=n.id;n.type===`openSheetSession`&&$.reserveOpen(n);try{if(n.type===`openSheetSession`){await Q.ensureReady(),Q.archive&&Q.run(()=>Q.archive?.assert_healthy()),await $.open(n.sheetIndex,n.sheetName,n),await $.postOpenedSafely(n,()=>self.postMessage({type:`sheetSessionOpened`,id:r,sessionId:n.sessionId,operationId:n.operationId,generation:n.generation}),e=>self.postMessage({type:`error`,id:r,...L(e)}));return}n.type===`parse`&&await $.reset(),await $.run(async()=>{if(await Q.ensureReady(),n.type!==`parse`&&Q.archive){let e=Q.archive;Q.run(()=>e.assert_healthy())}if(n.type===`parse`){let[t,i,a]=xe(n.resourcePolicy),o=new Uint8Array(n.data),s=Q.run(()=>{let n=new e(o,t,i,a);return Q.setArchive(n),n.parse()}).buffer,c={type:`parsed`,id:r,workbookJson:s,usage:Q.run(()=>k(Q.archive.resource_usage()))};self.postMessage(c,[s]);return}let t=Q.archive;if(n.type===`extractImage`){if(!t)throw Error(`No xlsx loaded`);let e=Q.run(()=>t.extract_image(n.path).buffer),i={type:`imageExtracted`,id:r,bytes:e};self.postMessage(i,[e]);return}if(n.type===`resourceUsage`){if(!t)throw Error(`No xlsx loaded`);let e=Q.run(()=>k(t.resource_usage()));self.postMessage({type:`resourceUsage`,id:r,usage:e});return}if(n.type===`toMarkdown`){if(!t)throw Error(`No xlsx loaded`);let e={type:`markdownRendered`,id:r,markdown:Q.run(()=>t.to_markdown())};self.postMessage(e);return}})}catch(e){n.type===`openSheetSession`&&$.abandonOpen(n.sessionId);let t={type:`error`,id:r,...L(e)};try{self.postMessage(t)}catch{}}};", st = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", ot], { type: "text/javascript;charset=utf-8" });
|
|
100
|
-
function
|
|
101
|
+
var st = "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();_.__wbg_xlsxarchive_free(e,0)}acknowledge_sheet_cursor_terminal(){let e=_.xlsxarchive_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);if(e[1])throw f(e[0])}assert_healthy(){let e=_.xlsxarchive_assert_healthy(this.__wbg_ptr);if(e[1])throw f(e[0])}cancel_sheet_cursor(){_.xlsxarchive_cancel_sheet_cursor(this.__wbg_ptr)}close_sheet_cursor(){_.xlsxarchive_close_sheet_cursor(this.__wbg_ptr)}extract_image(e){let t=d(e,_.__wbindgen_malloc,_.__wbindgen_realloc),n=g,i=_.xlsxarchive_extract_image(this.__wbg_ptr,t,n);if(i[3])throw f(i[2]);var a=r(i[0],i[1]).slice();return _.__wbindgen_free(i[0],i[1]*1,1),a}constructor(e,t,r,i){let a=u(e,_.__wbindgen_malloc),o=g,s=_.xlsxarchive_new(a,o,!l(t),l(t)?BigInt(0):t,!l(r),l(r)?BigInt(0):r,!l(i),l(i)?BigInt(0):i);if(s[2])throw f(s[1]);return this.__wbg_ptr=s[0]>>>0,n.register(this,this.__wbg_ptr,this),this}open_sheet_cursor(e,t){let n=d(t,_.__wbindgen_malloc,_.__wbindgen_realloc),r=g,i=_.xlsxarchive_open_sheet_cursor(this.__wbg_ptr,e,n,r);if(i[1])throw f(i[0])}parse(){let e=_.xlsxarchive_parse(this.__wbg_ptr);if(e[3])throw f(e[2]);var t=r(e[0],e[1]).slice();return _.__wbindgen_free(e[0],e[1]*1,1),t}pull_sheet_cursor(e){let t=_.xlsxarchive_pull_sheet_cursor(this.__wbg_ptr,e);if(t[3])throw f(t[2]);var n=r(t[0],t[1]).slice();return _.__wbindgen_free(t[0],t[1]*1,1),n}resource_usage(){let e=_.xlsxarchive_resource_usage(this.__wbg_ptr);if(e[3])throw f(e[2]);var t=r(e[0],e[1]).slice();return _.__wbindgen_free(e[0],e[1]*1,1),t}sheet_cursor_pull_finished(){return _.xlsxarchive_sheet_cursor_pull_finished(this.__wbg_ptr)!==0}sheet_cursor_resource_usage(){let e=_.xlsxarchive_sheet_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw f(e[2]);var t=r(e[0],e[1]).slice();return _.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=_.xlsxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,f(i[2]);return e=n,t=r,o(n,r)}finally{_.__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_throw_6b64449b9b9ed33c:function(e,t){throw Error(o(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(o(e,t))}finally{_.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=d(n,_.__wbindgen_malloc,_.__wbindgen_realloc),i=g;a().setInt32(e+4,i,!0),a().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return o(e,t)},__wbindgen_init_externref_table:function(){let e=_.__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=>_.__wbg_xlsxarchive_free(e>>>0,1));function r(e,t){return e>>>=0,c().subarray(e/1,e/1+t)}let i=null;function a(){return(i===null||i.buffer.detached===!0||i.buffer.detached===void 0&&i.buffer!==_.memory.buffer)&&(i=new DataView(_.memory.buffer)),i}function o(e,t){return e>>>=0,ee(e,t)}let s=null;function c(){return(s===null||s.byteLength===0)&&(s=new Uint8Array(_.memory.buffer)),s}function l(e){return e==null}function u(e,t){let n=t(e.length*1,1)>>>0;return c().set(e,n/1),g=e.length,n}function d(e,t,n){if(n===void 0){let n=h.encode(e),r=t(n.length,1)>>>0;return c().subarray(r,r+n.length).set(n),g=n.length,r}let r=e.length,i=t(r,1)>>>0,a=c(),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=c().subarray(i+o,i+r),a=h.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return g=o,i}function f(e){let t=_.__wbindgen_externrefs.get(e);return _.__externref_table_dealloc(e),t}let p=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});p.decode();let m=0;function ee(e,t){return m+=t,m>=2146435072&&(p=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),p.decode(),m=t),p.decode(c().subarray(e,e+t))}const h=new TextEncoder;`encodeInto`in h||(h.encodeInto=function(e,t){let n=h.encode(e);return t.set(n),{read:e.length,written:n.length}});let g=0,_;function v(e,t){return _=e.exports,i=null,s=null,_.__wbindgen_start(),_}async function te(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 y(e){if(_!==void 0)return _;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 te(await e,n);return v(r,i)}async function ne(e){return _=void 0,i=null,s=null,y(e)}var b=class e extends Error{code;constructor(t,n){super(n),this.name=`OoxmlError`,this.code=t,Object.setPrototypeOf(this,e.prototype)}},x=class e extends Error{code=`ooxml-resource-limit`;details;constructor(t,n){super(t),this.name=`OoxmlResourceLimitError`;let r=n.violation,i=Object.freeze({format:r.format,operation:r.operation,resource:r.resource,metric:r.metric,...r.part===void 0?{}:{part:r.part},limit:r.limit,observed:r.observed,configurable:r.configurable,usage:Object.freeze({archiveEntryCount:r.usage.archiveEntryCount,declaredInflatedBytes:r.usage.declaredInflatedBytes,...r.usage.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:r.usage.largestInflatedEntryBytes},distinctInflatedBytes:r.usage.distinctInflatedBytes,operationInflatedBytes:r.usage.operationInflatedBytes})});this.details=Object.freeze({stage:n.stage,violation:i}),Object.setPrototypeOf(this,e.prototype)}},re=class e extends RangeError{code=`ooxml-decoded-image-limit`;constructor(t,n,r){super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`),this.metric=t,this.limit=n,this.observed=r,this.name=`OoxmlDecodedImageLimitError`,Object.setPrototypeOf(this,e.prototype)}};function ie(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 ae=class{state=`uninitialized`;generationValue=0;readiness;poisonListeners=new Set;constructor(e,t,n){this.initialize=e,this.reinitialize=t,this.normalizeFailure=n}get generation(){return this.generationValue}get poisoned(){return this.state===`poisoned`}onPoison(e){return this.poisonListeners.add(e),()=>this.poisonListeners.delete(e)}async ensureReady(){if(this.state!==`ready`){if(!this.readiness){let e=this.state===`uninitialized`?this.initialize:this.reinitialize;this.readiness=Promise.resolve().then(e).then(()=>{this.generationValue+=1,this.state=`ready`,this.readiness=void 0},e=>{throw this.readiness=void 0,e})}await this.readiness}}run(e){try{return e()}catch(e){let t=this.normalizeFailure(e);throw t?(this.poison(t),t):e}}tryRunReady(e){if(this.state!==`ready`)return{current:!1};let t=this.generationValue,n=this.run(e);return this.state!==`ready`||t!==this.generationValue?{current:!1}:{current:!0,generation:t,value:n}}poison(e){this.state=`poisoned`,this.readiness=void 0;for(let t of this.poisonListeners)t(e)}assertCurrent(e){if(this.state!==`ready`||e!==this.generationValue)throw Error(`WASM archive session belongs to a discarded runtime generation`)}},S=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function oe(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function se(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}function C(e,t){return e({module_or_path:t})}var ce=class{runtime;wasmInput=null;currentArchive=null;constructor(e,t={}){this.init=e,this.options=t,this.runtime=new ae(()=>this.invokeConfigured(this.init),()=>this.invokeConfigured(this.options.reinit??this.init),le),this.runtime.onPoison(()=>this.dropPoisonedArchive())}setWasmInput(e){this.wasmInput=e,this.runtime.ensureReady().catch(()=>void 0)}setWasmUrl(e){this.setWasmInput(e)}get archive(){return this.currentArchive}setArchive(e){this.freeArchive(),this.currentArchive=e}disposeArchive(){this.freeArchive()}get poisoned(){return this.runtime.poisoned}async ensureReady(){await this.runtime.ensureReady()}run(e){return this.runtime.run(e)}poison(){this.runtime.poison(new S(`WASM parser was recycled`))}invokeConfigured(e){return this.wasmInput===null?Promise.reject(Error(`WasmParserHost: setWasmInput was never called`)):C(e,this.wasmInput)}freeArchive(){this.currentArchive!==null&&this.options.freeArchive&&this.options.freeArchive(this.currentArchive),this.currentArchive=null}dropPoisonedArchive(){let e=this.currentArchive;this.currentArchive=null,se(e)}};function le(e){return oe(e)?new S(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`):null}function w(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function ue(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return w(t.requiredBytes)&&w(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var T=class e extends RangeError{code=`ooxml-insufficient-credit`;requiredBytes;offeredBytes;constructor(t){super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`),this.name=`PullSessionInsufficientCreditError`,this.requiredBytes=t.requiredBytes,this.offeredBytes=t.offeredBytes,Object.setPrototypeOf(this,e.prototype)}};function de(e){if(e instanceof T)return e;let t=e instanceof Error?e.message:String(e);if(!t.startsWith(`OOXML_INSUFFICIENT_CREDIT:`))return;let n;try{n=JSON.parse(t.slice(26))}catch{return}if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n;if(!(r.code!==`ooxml-insufficient-credit`||!ue(r)))return new T(r)}const E=`OOXML_RESOURCE_LIMIT:`;function D(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function O(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return D(t.archiveEntryCount)&&D(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||D(t.largestInflatedEntryBytes))&&D(t.distinctInflatedBytes)&&D(t.operationInflatedBytes)}function k(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{throw TypeError(`OOXML resource usage checkpoint is not valid JSON`)}if(!O(t))throw TypeError(`OOXML resource usage checkpoint is invalid`);return t}function fe(e){return e===`docx`||e===`xlsx`||e===`pptx`}function pe(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function A(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function j(e){return A(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function me(e){return!A(e,4096)||e.startsWith(`/`)||e.startsWith(`\\\\`)||e.includes(`\\\\`)||e.includes(`?`)||e.includes(`#`)||e.includes(`://`)||/^[a-z]:/iu.test(e)?!1:e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}const M=new Map([[`archive-entry:declared-inflated-bytes`,{stage:`container`,part:`required`}],[`archive-entry:actual-inflated-bytes`,{stage:`decompression`,part:`required`}],[`archive:entry-count`,{stage:`container`,part:`forbidden`}],[`archive:central-directory-bytes`,{stage:`container`,part:`forbidden`,configurable:!1}],[`archive:distinct-inflated-bytes`,{stage:`decompression`,part:`required`}],[`xml-event:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-context:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-tree:depth`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-row:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-shell:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}]]),he=new Set([...M.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),ge=new Set([...M.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function _e(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!fe(t.format)||!A(t.operation,256)||!j(t.resource)||!j(t.metric)||!D(t.limit)||!D(t.observed)||typeof t.configurable!=`boolean`||!O(t.usage)?!1:!(`part`in t)||me(t.part)}function N(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!pe(t.stage)||!_e(t.violation))return!1;let n=t.violation,r=M.get(`${n.resource}:${n.metric}`);return r?t.stage!==r.stage||r.configurable===!1&&n.configurable!==!1?!1:r.part===`required`?n.part!==void 0:r.part===`forbidden`?n.part===void 0:!0:!(he.has(n.resource)&&ge.has(n.metric))}function P(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function F(e){if(!N(e))return;let t=e.violation,n={stage:e.stage,violation:{format:t.format,operation:t.operation,resource:t.resource,metric:t.metric,...t.part===void 0?{}:{part:t.part},limit:t.limit,observed:t.observed,configurable:t.configurable,usage:P(t.usage)}};return N(n)?n:void 0}function I(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``}: ${t.metric} ${t.observed} > ${t.limit}`}function ve(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(E))return;let n;try{n=JSON.parse(t.slice(21))}catch{return}if(!n||typeof n!=`object`)return;let r=n;if(!(r.code!==`ooxml-resource-limit`||!N(r.details)))return new x(I(r.details),r.details)}function ye(e){if(e instanceof re)return{message:e.message,errorName:e.name,code:e.code,decodedImage:{metric:e.metric,limit:e.limit,observed:e.observed}};let t=de(e);if(t)return{message:t.message,errorName:t.name,code:t.code,insufficientCredit:{requiredBytes:t.requiredBytes,offeredBytes:t.offeredBytes}};let n=e instanceof b||e instanceof x?e:ve(e);if(n instanceof x){let e=F(n.details);return e?{message:typeof n.message==`string`?n.message:I(e),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:e}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(n instanceof b)return{message:typeof n.message==`string`?n.message:String(n.message),errorName:A(n.name,128)?n.name:`OoxmlError`,...j(n.code)?{code:n.code}:{}};let r=e instanceof Error?e.message:String(e);if(typeof r==`string`&&r.startsWith(E))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let i=e instanceof Error?e:Error(r),a=i;return{message:typeof i.message==`string`?i.message:String(i.message),errorName:A(i.name,128)?i.name:`Error`,...typeof a.code==`string`?{code:a.code}:{}}}function L(e){try{return ye(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}function be(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer instanceof ArrayBuffer?e.buffer:e.slice().buffer}Object.freeze({maxArchiveEntryBytes:134217728,maxTotalInflatedBytes:268435456,maxArchiveEntries:4096});function xe(e){return[e.maxArchiveEntryBytes===null?0n:BigInt(e.maxArchiveEntryBytes),e.maxTotalInflatedBytes===null?0n:BigInt(e.maxTotalInflatedBytes),e.maxArchiveEntries===null?0n:BigInt(e.maxArchiveEntries)]}const R=`ooxml-pull-v1`;function z(e,t){if(!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} must be a positive safe integer`)}function Se(e){if(!(typeof e==`string`&&e.length>0||typeof e==`number`&&Number.isSafeInteger(e)&&e>0))throw RangeError(`session id must be a non-empty string or positive safe integer`)}var Ce=class{owner;queue=Promise.resolve();leases=new Map;retainedBytes=0;retainedCount=0;maxRetainedBytes;maxRetainedCount;cleanups=new Set;pendingFatalCleanups=[];poisonRunning=!1;fatal;constructor(e){this.maxRetainedBytes=e?.maxRetainedBytes??64*1024*1024,this.maxRetainedCount=e?.maxRetainedCount??256,z(this.maxRetainedBytes,`max retained lease bytes`),z(this.maxRetainedCount,`max retained lease count`)}enqueue(e){let t=this.queue.then(e,e);return this.queue=t.then(()=>void 0,()=>void 0),t}acquire(e){return this.owner===void 0?(this.owner=e,!0):this.owner===e}release(e){this.owner===e&&(this.owner=void 0)}retainLease(e,t,n){if(!Number.isSafeInteger(n)||n<0)throw RangeError(`retained lease bytes are invalid`);let r=this.leases.get(e)??new Map;if(r.has(t))throw Error(`driver returned a duplicate lease id`);if(this.retainedCount+1>this.maxRetainedCount)throw RangeError(`retained lease count exceeds limit`);if(this.retainedBytes+n>this.maxRetainedBytes)throw RangeError(`retained lease bytes exceed limit`);r.set(t,n),this.leases.set(e,r),this.retainedCount++,this.retainedBytes+=n}releaseLease(e,t){let n=this.leases.get(e),r=n?.get(t);r!==void 0&&(n?.delete(t),n?.size===0&&this.leases.delete(e),this.retainedCount--,this.retainedBytes-=r)}registerCleanup(e){return this.fatal?(this.poisonRunning?this.pendingFatalCleanups.push(e):this.enqueue(e).catch(()=>void 0),()=>void 0):(this.cleanups.add(e),()=>this.cleanups.delete(e))}get fatalError(){return this.fatal}get registeredHostCount(){return this.cleanups.size}async poison(e){if(this.fatal??=e,this.poisonRunning)return this.fatal;this.poisonRunning=!0,this.pendingFatalCleanups.push(...this.cleanups);try{let e;for(;(e=this.pendingFatalCleanups.shift())!==void 0;)await e().catch(()=>void 0)}finally{this.poisonRunning=!1}return this.fatal}},we=class{options;coordinator;coordinatorOwner=Symbol(`pull-session-host`);unregisterCleanup;sequence=0;unacked;leases=new Map;activeDriverLeases=new Set;nextWireLeaseId;cancelRequested=!1;cancelComplete=!1;closeRequested=!1;closeComplete=!1;driverCancelComplete=!1;driverCloseComplete=!1;completed=!1;constructor(e){Se(e.sessionId),z(e.operationId,`operation id`),z(e.generation,`generation`),z(e.maxByteCredit,`max byte credit`),e.wireLeaseIdStart!==void 0&&z(e.wireLeaseIdStart,`wire lease id start`),this.options=e,this.coordinator=e.coordinator,this.nextWireLeaseId=e.wireLeaseIdStart??1,this.unregisterCleanup=this.coordinator.registerCleanup(()=>this.forceFatalCleanup())}dispatch(e,t){return this.coordinator.enqueue(async()=>{let n=await this.execute(e);try{t(n.response,n.transfer)}catch(e){throw await this.rollbackFailedPost(n),e}})}async rollbackFailedPost(e){let t=e.response;if(t.kind===`chunk`){let n=t.leaseId===void 0?void 0:this.leases.get(t.leaseId);try{await this.options.driver.disposeInvalidChunk?.({payload:t.payload,byteLength:t.byteLength,done:t.done,leaseId:n?.driverLeaseId,retainedBytes:n?.retainedBytes,transfer:e.transfer})}catch{}}this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);for(let[e,t]of[...this.leases])try{await this.options.driver.releaseLease?.(t.driverLeaseId)}catch{}finally{this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e)}if(this.cancelRequested=!0,!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch{}this.unregisterCleanup()}async execute(e){try{if(this.isStaleLifecycle(e)){let t=e.kind===`cancel`?`cancel`:`close`;return this.sameOperationIdentity(e)?{response:this.accepted(e,t,!0)}:{response:this.errorResponse(e,{message:`stale lifecycle targets another session or operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`})}}this.validateCommandIdentity(e);let t=this.coordinator.fatalError;if(t)return e.kind===`pull`?{response:this.errorResponse(e,t)}:(e.kind===`cancel`?await this.cancel():e.kind===`close`?await this.close():e.kind===`release`&&await this.release(e.leaseId),{response:this.accepted(e,e.kind)});switch(e.kind){case`pull`:return await this.pull(e);case`ack`:return await this.ack(e.sequence),{response:this.accepted(e,`ack`)};case`release`:return await this.release(e.leaseId),{response:this.accepted(e,`release`)};case`cancel`:return await this.cancel(),{response:this.accepted(e,`cancel`)};case`close`:return await this.close(),{response:this.accepted(e,`close`)}}}catch(t){let n=L(t);return n.code===`ooxml-resource-limit`&&(n=await this.coordinator.poison(n)),{response:this.errorResponse(e,n)}}}async pull(e){if(this.closeRequested||this.cancelRequested||this.completed)throw Error(`pull session is closed`);if(this.unacked)throw Error(`previous chunk is not acknowledged`);if(!Number.isSafeInteger(e.sequence)||e.sequence<0||e.sequence!==this.sequence)throw Error(`pull command sequence mismatch`);if(this.validateHostCredit(e.byteCredit),!this.coordinator.acquire(this.coordinatorOwner))throw Error(`another operation has an unacknowledged package chunk`);let t;try{t=await this.options.driver.pull(e.byteCredit)}catch(e){throw this.coordinator.release(this.coordinatorOwner),e}let n=!1,r=!1,i,a;try{let o=this.options.driver.measureChunk(t),s=this.arrayBufferTransferBytes(t.transfer);if(o<s)throw RangeError(`measured chunk bytes are below ArrayBuffer transfer bytes`);if(a=Math.max(o,s),t.leaseId!==void 0){if(z(t.leaseId,`lease id`),t.retainedBytes===void 0)throw Error(`retained lease bytes are required`);if(this.activeDriverLeases.has(t.leaseId))throw r=!0,Error(`driver returned an active duplicate lease id`);i=this.allocateWireLeaseId(),this.coordinator.retainLease(this.coordinatorOwner,i,t.retainedBytes),this.leases.set(i,{driverLeaseId:t.leaseId,retainedBytes:t.retainedBytes}),this.activeDriverLeases.add(t.leaseId),n=!0}else if(t.retainedBytes!==void 0)throw Error(`retained lease bytes require a lease id`);if(!Number.isSafeInteger(a)||a<0)throw RangeError(`host chunk byte length must be a non-negative safe integer`);if(a>e.byteCredit)throw RangeError(`host chunk exceeds byte credit`)}catch(e){let a;try{await this.options.driver.disposeInvalidChunk?.(t)}catch(e){a=e}if(n&&i!==void 0)try{await this.release(i)}catch(e){a??=e}else if(t.leaseId!==void 0&&!r)try{await this.options.driver.releaseLease?.(t.leaseId)}catch(e){a??=e}if(r)try{await this.cancel()}catch(e){a??=e}throw this.coordinator.release(this.coordinatorOwner),a||e}return this.unacked={sequence:this.sequence,done:t.done},{response:{kind:`chunk`,protocol:R,...this.identity(),requestId:e.requestId,sequence:this.sequence,byteLength:a,done:t.done,payload:t.payload,leaseId:i,usage:this.resourceUsage()},transfer:t.transfer}}async ack(e){if(!Number.isSafeInteger(e)||e<0)throw RangeError(`invalid ack sequence`);if(e<this.sequence)return;if(!this.unacked||e!==this.sequence)throw Error(`ack sequence mismatch`);let t=this.unacked.done;await this.options.driver.acknowledge?.(e),this.unacked=void 0,this.coordinator.release(this.coordinatorOwner),this.sequence++,t&&(this.completed=!0,this.maybeUnregisterCompleted())}async release(e){z(e,`wire lease id`);let t=this.leases.get(e);t&&(await this.options.driver.releaseLease?.(t.driverLeaseId),this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e),this.maybeUnregisterCompleted())}async cancel(){if(this.cancelComplete)return;this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.cancelComplete=!0,this.unregisterCleanup()}async close(){if(this.closeComplete)return;this.closeRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCloseComplete)try{await this.options.driver.close?.(),this.driverCloseComplete=!0}catch(t){e??=t}if(e)throw e;this.closeComplete=!0,this.unregisterCleanup()}async releaseAllLeases(){let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(e)throw e}validateCommandIdentity(e){if(e.protocol!==`ooxml-pull-v1`||e.sessionId!==this.options.sessionId||e.operationId!==this.options.operationId||e.generation!==this.options.generation||!Number.isSafeInteger(e.requestId)||e.requestId<=0)throw Error(`stale or mismatched pull session command`)}validateHostCredit(e){if(z(e,`byte credit`),e>this.options.maxByteCredit)throw RangeError(`byte credit exceeds host maximum`)}accepted(e,t,n=!1){return{kind:`accepted`,protocol:R,...n?{sessionId:e.sessionId,operationId:e.operationId,generation:e.generation}:this.identity(),requestId:e.requestId,command:t,usage:this.resourceUsage()}}identity(){return{sessionId:this.options.sessionId,operationId:this.options.operationId,generation:this.options.generation}}isStaleLifecycle(e){return(e.kind===`cancel`||e.kind===`close`)&&e.protocol===`ooxml-pull-v1`&&Number.isSafeInteger(e.requestId)&&e.requestId>0&&Number.isSafeInteger(e.generation)&&e.generation>0&&e.generation<this.options.generation}sameOperationIdentity(e){return e.sessionId===this.options.sessionId&&e.operationId===this.options.operationId}errorResponse(e,t){return{kind:`error`,protocol:R,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:t,usage:this.errorResourceUsage()}}async forceFatalCleanup(){this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.unregisterCleanup()}allocateWireLeaseId(){if(!Number.isSafeInteger(this.nextWireLeaseId)||this.nextWireLeaseId<=0)throw RangeError(`wire lease id space exhausted`);return this.nextWireLeaseId++}arrayBufferTransferBytes(e){let t=0;for(let n of e??[])if(n instanceof ArrayBuffer&&(t+=n.byteLength,!Number.isSafeInteger(t)))throw RangeError(`ArrayBuffer transfer bytes overflow`);return t}maybeUnregisterCompleted(){this.completed&&this.leases.size===0&&this.unregisterCleanup()}resourceUsage(){return this.options.driver.resourceUsage?.()}errorResourceUsage(){try{return this.resourceUsage()}catch{return}}};function Te(e,t){for(let n of e)for(let e of n.cells){let n=e.value;if(n.type===`shared`){let r=t[n.si];if(r){let t={type:`text`,text:r.text};r.runs!==void 0&&(t.runs=r.runs),r.phoneticRuns!==void 0&&(t.phoneticRuns=r.phoneticRuns),r.phoneticPr!==void 0&&(t.phoneticPr=r.phoneticPr),e.value=t}else e.value={type:`text`,text:``}}}return e}function Ee(e,t,n,r){let i=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=JSON.parse(new TextDecoder().decode(i));if(!a||typeof a!=`object`||!(`kind`in a))throw Error(`worksheet cursor returned an invalid unit`);let o=a;if(t!==(o.kind===`finished`))throw Error(`worksheet cursor terminal marker mismatch`);if(o.kind===`rows`){if(!Array.isArray(o.rows))throw Error(`worksheet row unit is missing rows`);return n&&Te(o.rows,n),r?.(o.rows),{kind:`rows`,rows:o.rows}}if(o.kind===`finished`){if(!o.worksheet||typeof o.worksheet!=`object`)throw Error(`worksheet terminal unit is missing its worksheet`);return o.worksheet.rows=[],{kind:`finished`,worksheet:o.worksheet}}throw Error(`worksheet cursor returned an unknown unit kind`)}function B(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function V(e,t,n){return B(e,`resource measurement`),B(t,`resource measurement`),B(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function H(e,t=2**53-1){B(t,`resource measurement limit`);let n=0;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=3}else a=3;if(n=V(n,a,t),n>t)return n}return n}function U(e,t=2**53-1){B(t,`resource measurement limit`);let n=V(0,2,t);if(n>t)return n;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i===34||i===92||i===8||i===9||i===10||i===12||i===13)a=2;else if(i<=31)a=6;else if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=6}else a=i>=55296&&i<=57343?6:3;if(n=V(n,a,t),n>t)return n}return n}function W(e,t){return V(0,e,t)}function G(e,t=2**53-1,n=!1){if(B(t,`resource measurement limit`),e===null)return{jsonBytes:W(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:U(e,t),stringValueUtf8Bytes:H(e,t)};if(typeof e==`boolean`)return{jsonBytes:W(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:W((Number.isFinite(e)?String(Object.is(e,-0)?0:e):`null`).length,t),stringValueUtf8Bytes:0};if(typeof e==`bigint`)throw TypeError(`BigInt values cannot be serialized to JSON`);if(Array.isArray(e)){let n=W(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=V(n,1,t));let a=G(e[i],t,!0);n=V(n,a.jsonBytes,t),r=V(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=W(2,t),r=0,i=0;for(let[a,o]of Object.entries(e)){if(o===void 0||typeof o==`function`||typeof o==`symbol`)continue;i++!==0&&(n=V(n,1,t)),n=V(n,U(a,t),t),n=V(n,1,t);let e=G(o,t);n=V(n,e.jsonBytes,t),r=V(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?W(4,t):0,stringValueUtf8Bytes:0}}const K=1e5,q=25e4,J=33554432,Y=67108864,De=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function Oe(e){let t=e.reduce((e,t)=>V(e,t.cells.length,q),0);return{rows:e.length,cells:t,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=G(t.value,J).stringValueUtf8Bytes;return V(e,V(n,t.formula===void 0?0:H(t.formula,J),J),J)},e),0)}}function ke(e,t){let n=G(e,67108864);return{...t,jsonBytes:n.jsonBytes}}function Ae(e,t){return{rows:V(e.rows,t.rows,K),cells:V(e.cells,t.cells,q),ownedUtf8Bytes:V(e.ownedUtf8Bytes,t.ownedUtf8Bytes,J)}}function X(e,t,n,r,i,a,o){let s=n===`worksheet-json`?`serialization`:`parsing`;return new x(`OOXML resource limit exceeded${t?` for ${t}`:``}: ${r} ${a} > ${i}`,{stage:s,violation:{format:`xlsx`,operation:e,resource:n,metric:r,...t===void 0?{}:{part:t},limit:i,observed:Math.min(a,i+1),configurable:!1,usage:o??De}})}function Z(e,t,n,r){let i=[[`rows`,e.rows,K],[`cells`,e.cells,q],[`owned-utf8-bytes`,e.ownedUtf8Bytes,J]];for(let[e,a,o]of i)if(a>o)throw X(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,o,a,r)}function je(e,t,n,r){if(e>Y)throw X(t,n,`worksheet-json`,`bytes`,Y,e,r)}var Me=class{coordinator=new Ce;sessions=new Map;operationTail=Promise.resolve();pendingOpens=new Map;resourceFailure;constructor(e,t,n=e=>e(this.requireArchive()),r){this.archive=e,this.acceptWorksheet=t,this.executeArchive=n,this.prepareRows=r}reserveOpen(e){this.pendingOpens.set(e.sessionId,{identity:e,canceled:!1})}abandonOpen(e){this.pendingOpens.delete(e)}get pendingOpenCount(){return this.pendingOpens.size}async open(e,t,n){if(this.resourceFailure)throw this.resourceFailure;let r=this.pendingOpens.get(n.sessionId);if(!r||r.identity.operationId!==n.operationId||r.identity.generation!==n.generation)throw Error(`worksheet pull session open reservation is stale or missing`);let i,a=new Promise(e=>{i=e}),o=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(r.canceled)throw Error(`worksheet pull session open was canceled`);this.executeArchive(n=>n.open_sheet_cursor(e,t));let a=[],o={rows:0,cells:0,ownedUtf8Bytes:0},s,c=!1,l=new we({...n,maxByteCredit:67108864,coordinator:this.coordinator,driver:{pull:()=>{let e=this.executeArchive(e=>e.pull_sheet_cursor(128)),t=this.executeArchive(e=>e.sheet_cursor_pull_finished());if(this.acceptWorksheet){let n=Ee(e,t,void 0,this.prepareRows);try{if(n.kind===`rows`){let e=Ae(o,Oe(n.rows));Z(e,`get-worksheet-worker`,void 0,this.readResourceUsage()),a.push(...n.rows),o=e}else s=n.worksheet}catch(e){throw e instanceof x&&(this.resourceFailure??=e),e}}c=t;let n=be(e);return{payload:n,byteLength:n.byteLength,done:t,transfer:[n]}},measureChunk:({payload:e})=>e.byteLength,acknowledge:()=>{if(!c)return;let t,r;try{if(this.acceptWorksheet){if(!s)throw Error(`worksheet terminal payload is missing`);s.rows=s.parseError?[]:a;let n=s.parseError?{rows:0,cells:0,ownedUtf8Bytes:0}:o,i=ke(s,n),c=this.readResourceUsage();Z(i,`get-worksheet-worker`,void 0,c),je(i.jsonBytes,`get-worksheet-worker`,void 0,c);let l=this.acceptWorksheet(e,s,i,c);typeof l==`function`?t=l:l&&({rollback:t,commit:r}=l)}this.executeArchive(e=>e.acknowledge_sheet_cursor_terminal()),r?.()}catch(e){throw t?.(),e instanceof x&&(this.resourceFailure??=e),e}c=!1,this.sessions.delete(n.sessionId),i()},cancel:()=>{try{this.archive()&&this.executeArchive(e=>e.cancel_sheet_cursor())}finally{this.sessions.delete(n.sessionId),i()}},close:()=>{try{this.archive()&&this.executeArchive(e=>e.close_sheet_cursor())}finally{this.sessions.delete(n.sessionId),i()}},resourceUsage:()=>this.readResourceUsage()}});this.sessions.set(n.sessionId,{host:l,identity:n}),this.pendingOpens.delete(n.sessionId)}));this.operationTail=o.then(()=>a,()=>void 0);try{await o}catch(e){throw this.pendingOpens.delete(n.sessionId),i(),e}}async postOpenedSafely(e,t,n){try{t()}catch(t){await this.closeIdentity(e);try{n(t)}catch{}}}dispatch(e,t){let n=this.sessions.get(e.sessionId);if(n)return n.host.dispatch(e,t);let r=this.pendingOpens.get(e.sessionId);if(r&&(e.kind===`cancel`||e.kind===`close`)){let n=r.identity.operationId===e.operationId&&r.identity.generation===e.generation;return n&&(r.canceled=!0),t(n?{protocol:R,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}:{protocol:R,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:{message:`stale lifecycle targets another pending worksheet operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`}}),Promise.resolve()}return e.kind===`cancel`||e.kind===`close`?(t({protocol:R,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}),Promise.resolve()):(t({protocol:R,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:L(Error(`worksheet pull session is not open`))}),Promise.resolve())}async dispatchSafely(e,t){try{await this.dispatch(e,t)}catch(n){try{t({protocol:R,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:L(n)})}catch{}}}run(e){let t=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(this.resourceFailure)throw this.resourceFailure;return e()})).catch(e=>{throw e instanceof x&&(this.resourceFailure??=e),e});return this.operationTail=t.then(()=>void 0,()=>void 0),t}async reset(){for(let e of this.pendingOpens.values())e.canceled=!0;let e=1;for(let{host:t,identity:n}of[...this.sessions.values()])await t.dispatch({protocol:R,kind:`close`,...n,requestId:e++},()=>void 0);this.sessions.clear(),await this.operationTail,this.pendingOpens.clear(),this.resourceFailure=void 0}requireArchive(){let e=this.archive();if(!e)throw Error(`Workbook not loaded`);return e}async closeIdentity(e){let t=this.sessions.get(e.sessionId);if(t){await t.host.dispatch({protocol:R,kind:`close`,...e,requestId:1},()=>void 0);return}let n=this.pendingOpens.get(e.sessionId);n&&n.identity.operationId===e.operationId&&n.identity.generation===e.generation&&(n.canceled=!0)}readResourceUsage(){try{return k(this.executeArchive(e=>e.sheet_cursor_resource_usage()))}catch(e){if(String(e).includes(`worksheet cursor usage is unavailable`))return;throw e}}};function Ne(e){return!!e&&typeof e==`object`&&e.protocol===`ooxml-pull-v1`}const Q=new ce(y,{freeArchive:e=>e.free(),reinit:ne}),$=new Me(()=>Q.archive,void 0,e=>{let t=Q.archive;if(!t)throw Error(`Workbook not loaded`);return Q.run(()=>e(t))});self.onmessage=async t=>{let n=t.data;if(Ne(n)){await $.dispatchSafely(n,(e,t)=>self.postMessage(e,t));return}if(n.type===`init`){Q.setWasmInput(ie(n.wasmUrl)??n.wasmUrl);return}let r=n.id;n.type===`openSheetSession`&&$.reserveOpen(n);try{if(n.type===`openSheetSession`){await Q.ensureReady(),Q.archive&&Q.run(()=>Q.archive?.assert_healthy()),await $.open(n.sheetIndex,n.sheetName,n),await $.postOpenedSafely(n,()=>self.postMessage({type:`sheetSessionOpened`,id:r,sessionId:n.sessionId,operationId:n.operationId,generation:n.generation}),e=>self.postMessage({type:`error`,id:r,...L(e)}));return}n.type===`parse`&&await $.reset(),await $.run(async()=>{if(await Q.ensureReady(),n.type!==`parse`&&Q.archive){let e=Q.archive;Q.run(()=>e.assert_healthy())}if(n.type===`parse`){let[t,i,a]=xe(n.resourcePolicy),o=new Uint8Array(n.data),s=Q.run(()=>{let n=new e(o,t,i,a);return Q.setArchive(n),n.parse()}).buffer,c={type:`parsed`,id:r,workbookJson:s,usage:Q.run(()=>k(Q.archive.resource_usage()))};self.postMessage(c,[s]);return}let t=Q.archive;if(n.type===`extractImage`){if(!t)throw Error(`No xlsx loaded`);let e=Q.run(()=>t.extract_image(n.path).buffer),i={type:`imageExtracted`,id:r,bytes:e};self.postMessage(i,[e]);return}if(n.type===`resourceUsage`){if(!t)throw Error(`No xlsx loaded`);let e=Q.run(()=>k(t.resource_usage()));self.postMessage({type:`resourceUsage`,id:r,usage:e});return}if(n.type===`toMarkdown`){if(!t)throw Error(`No xlsx loaded`);let e={type:`markdownRendered`,id:r,markdown:Q.run(()=>t.to_markdown())};self.postMessage(e);return}})}catch(e){n.type===`openSheetSession`&&$.abandonOpen(n.sessionId);let t={type:`error`,id:r,...L(e)};try{self.postMessage(t)}catch{}}};", ct = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", st], { type: "text/javascript;charset=utf-8" });
|
|
102
|
+
function lt(e) {
|
|
101
103
|
let t;
|
|
102
104
|
try {
|
|
103
|
-
if (t =
|
|
105
|
+
if (t = ct && (self.URL || self.webkitURL).createObjectURL(ct), !t) throw "";
|
|
104
106
|
let n = new Worker(t, {
|
|
105
107
|
type: "module",
|
|
106
108
|
name: e?.name
|
|
@@ -109,7 +111,7 @@ function ct(e) {
|
|
|
109
111
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
110
112
|
}), n;
|
|
111
113
|
} catch {
|
|
112
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
114
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(st), {
|
|
113
115
|
type: "module",
|
|
114
116
|
name: e?.name
|
|
115
117
|
});
|
|
@@ -117,19 +119,19 @@ function ct(e) {
|
|
|
117
119
|
}
|
|
118
120
|
//#endregion
|
|
119
121
|
//#region packages/xlsx/src/wasm/xlsx_parser_bg.wasm?url
|
|
120
|
-
var
|
|
122
|
+
var ut = new URL("xlsx_parser_bg.wasm", import.meta.url).href;
|
|
121
123
|
//#endregion
|
|
122
124
|
//#region packages/xlsx/src/sheet-visibility.ts
|
|
123
|
-
function
|
|
125
|
+
function dt(e, t) {
|
|
124
126
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? "visible" : e[t].visibility ?? "visible";
|
|
125
127
|
}
|
|
126
128
|
//#endregion
|
|
127
129
|
//#region packages/xlsx/src/phonetic.ts
|
|
128
|
-
function
|
|
130
|
+
function ft(e) {
|
|
129
131
|
return Array.from(e);
|
|
130
132
|
}
|
|
131
|
-
function
|
|
132
|
-
let a =
|
|
133
|
+
function pt(e, t, n, r, i) {
|
|
134
|
+
let a = ft(t), o = a.length, s = [];
|
|
133
135
|
for (let t of e) {
|
|
134
136
|
let e = t.sb, c = t.eb;
|
|
135
137
|
if (!(e < c) || e >= o) continue;
|
|
@@ -145,37 +147,37 @@ function ft(e, t, n, r, i) {
|
|
|
145
147
|
}
|
|
146
148
|
//#endregion
|
|
147
149
|
//#region packages/xlsx/src/formula.ts
|
|
148
|
-
function
|
|
150
|
+
function Y(e) {
|
|
149
151
|
return Array.isArray(e) ? e : [e];
|
|
150
152
|
}
|
|
151
|
-
function
|
|
153
|
+
function mt(e) {
|
|
152
154
|
return Array.isArray(e) ? e[0] ?? 0 : e;
|
|
153
155
|
}
|
|
154
|
-
var
|
|
155
|
-
function
|
|
156
|
+
var ht = 8;
|
|
157
|
+
function gt(e, t) {
|
|
156
158
|
try {
|
|
157
|
-
return
|
|
159
|
+
return _t(Ct(e, t));
|
|
158
160
|
} catch {
|
|
159
161
|
return !1;
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
|
-
function
|
|
163
|
-
let t =
|
|
164
|
+
function _t(e) {
|
|
165
|
+
let t = mt(e);
|
|
164
166
|
return typeof t == "boolean" ? t : typeof t == "number" ? t !== 0 : typeof t == "string" ? t.length > 0 && t.toUpperCase() !== "FALSE" : !1;
|
|
165
167
|
}
|
|
166
|
-
function
|
|
167
|
-
let t =
|
|
168
|
+
function X(e) {
|
|
169
|
+
let t = mt(e);
|
|
168
170
|
if (typeof t == "number") return t;
|
|
169
171
|
if (typeof t == "boolean") return +!!t;
|
|
170
172
|
if (t == null) return 0;
|
|
171
173
|
let n = parseFloat(String(t));
|
|
172
174
|
return isNaN(n) ? 0 : n;
|
|
173
175
|
}
|
|
174
|
-
function
|
|
175
|
-
let t =
|
|
176
|
+
function Z(e) {
|
|
177
|
+
let t = mt(e);
|
|
176
178
|
return t == null ? "" : typeof t == "boolean" ? t ? "TRUE" : "FALSE" : String(t);
|
|
177
179
|
}
|
|
178
|
-
var
|
|
180
|
+
var vt = new Set([
|
|
179
181
|
"<",
|
|
180
182
|
">",
|
|
181
183
|
"=",
|
|
@@ -187,7 +189,7 @@ var _t = new Set([
|
|
|
187
189
|
"^",
|
|
188
190
|
"%"
|
|
189
191
|
]);
|
|
190
|
-
function
|
|
192
|
+
function yt(e) {
|
|
191
193
|
let t = [], n = 0, r = e;
|
|
192
194
|
for (; n < r.length;) {
|
|
193
195
|
let e = r[n];
|
|
@@ -248,7 +250,7 @@ function vt(e) {
|
|
|
248
250
|
}), n = e;
|
|
249
251
|
continue;
|
|
250
252
|
}
|
|
251
|
-
if (
|
|
253
|
+
if (vt.has(e)) {
|
|
252
254
|
(e === "<" || e === ">") && (r[n + 1] === "=" || e === "<" && r[n + 1] === ">") ? (t.push({
|
|
253
255
|
kind: "op",
|
|
254
256
|
text: r.slice(n, n + 2)
|
|
@@ -258,12 +260,12 @@ function vt(e) {
|
|
|
258
260
|
}), n++);
|
|
259
261
|
continue;
|
|
260
262
|
}
|
|
261
|
-
if (e === "$" ||
|
|
263
|
+
if (e === "$" || bt(e)) {
|
|
262
264
|
let e = n;
|
|
263
|
-
for (; e < r.length && (r[e] === "$" ||
|
|
265
|
+
for (; e < r.length && (r[e] === "$" || xt(r[e]));) e++;
|
|
264
266
|
let i = r.slice(n, e);
|
|
265
267
|
n = e;
|
|
266
|
-
let a =
|
|
268
|
+
let a = St(i);
|
|
267
269
|
if (a) t.push({
|
|
268
270
|
kind: "ref",
|
|
269
271
|
text: i,
|
|
@@ -285,13 +287,13 @@ function vt(e) {
|
|
|
285
287
|
}
|
|
286
288
|
return t;
|
|
287
289
|
}
|
|
288
|
-
function yt(e) {
|
|
289
|
-
return e >= "A" && e <= "Z" || e >= "a" && e <= "z" || e === "_";
|
|
290
|
-
}
|
|
291
290
|
function bt(e) {
|
|
292
|
-
return
|
|
291
|
+
return e >= "A" && e <= "Z" || e >= "a" && e <= "z" || e === "_";
|
|
293
292
|
}
|
|
294
293
|
function xt(e) {
|
|
294
|
+
return bt(e) || e >= "0" && e <= "9" || e === ".";
|
|
295
|
+
}
|
|
296
|
+
function St(e) {
|
|
295
297
|
let t = 0, n = !1, r = !1;
|
|
296
298
|
e[t] === "$" && (n = !0, t++);
|
|
297
299
|
let i = t;
|
|
@@ -311,43 +313,43 @@ function xt(e) {
|
|
|
311
313
|
row: s
|
|
312
314
|
};
|
|
313
315
|
}
|
|
314
|
-
function
|
|
315
|
-
return
|
|
316
|
-
toks:
|
|
316
|
+
function Ct(e, t) {
|
|
317
|
+
return Et({
|
|
318
|
+
toks: yt(e),
|
|
317
319
|
pos: 0
|
|
318
320
|
}, t);
|
|
319
321
|
}
|
|
320
|
-
function
|
|
322
|
+
function wt(e) {
|
|
321
323
|
return e.toks[e.pos];
|
|
322
324
|
}
|
|
323
|
-
function
|
|
325
|
+
function Tt(e) {
|
|
324
326
|
return e.toks[e.pos++];
|
|
325
327
|
}
|
|
326
|
-
function Tt(e, t) {
|
|
327
|
-
return Et(e, t);
|
|
328
|
-
}
|
|
329
328
|
function Et(e, t) {
|
|
330
|
-
|
|
329
|
+
return Dt(e, t);
|
|
330
|
+
}
|
|
331
|
+
function Dt(e, t) {
|
|
332
|
+
let n = Ot(e, t), r = wt(e);
|
|
331
333
|
if (r && r.kind === "op" && (r.text === "<" || r.text === ">" || r.text === "<=" || r.text === ">=" || r.text === "=" || r.text === "<>")) {
|
|
332
|
-
|
|
333
|
-
let i =
|
|
334
|
-
return
|
|
334
|
+
Tt(e);
|
|
335
|
+
let i = Ot(e, t);
|
|
336
|
+
return kt(r.text, n, i);
|
|
335
337
|
}
|
|
336
338
|
return n;
|
|
337
339
|
}
|
|
338
|
-
function
|
|
339
|
-
let n =
|
|
340
|
+
function Ot(e, t) {
|
|
341
|
+
let n = At(e, t);
|
|
340
342
|
for (;;) {
|
|
341
|
-
let r =
|
|
343
|
+
let r = wt(e);
|
|
342
344
|
if (!r || r.kind !== "op" || r.text !== "&") break;
|
|
343
|
-
|
|
344
|
-
let i =
|
|
345
|
-
n =
|
|
345
|
+
Tt(e);
|
|
346
|
+
let i = At(e, t);
|
|
347
|
+
n = Z(n) + Z(i);
|
|
346
348
|
}
|
|
347
349
|
return n;
|
|
348
350
|
}
|
|
349
|
-
function
|
|
350
|
-
let r = typeof t == "string" && isNaN(parseFloat(t)) ? null :
|
|
351
|
+
function kt(e, t, n) {
|
|
352
|
+
let r = typeof t == "string" && isNaN(parseFloat(t)) ? null : X(t), i = typeof n == "string" && isNaN(parseFloat(n)) ? null : X(n);
|
|
351
353
|
if (r !== null && i !== null) switch (e) {
|
|
352
354
|
case "<": return r < i;
|
|
353
355
|
case ">": return r > i;
|
|
@@ -367,67 +369,67 @@ function Ot(e, t, n) {
|
|
|
367
369
|
}
|
|
368
370
|
return !1;
|
|
369
371
|
}
|
|
370
|
-
function
|
|
371
|
-
let n =
|
|
372
|
+
function At(e, t) {
|
|
373
|
+
let n = jt(e, t);
|
|
372
374
|
for (;;) {
|
|
373
|
-
let r =
|
|
375
|
+
let r = wt(e);
|
|
374
376
|
if (!r || r.kind !== "op" || r.text !== "+" && r.text !== "-") break;
|
|
375
|
-
|
|
376
|
-
let i =
|
|
377
|
-
n = r.text === "+" ?
|
|
377
|
+
Tt(e);
|
|
378
|
+
let i = jt(e, t);
|
|
379
|
+
n = r.text === "+" ? X(n) + X(i) : X(n) - X(i);
|
|
378
380
|
}
|
|
379
381
|
return n;
|
|
380
382
|
}
|
|
381
|
-
function
|
|
382
|
-
let n =
|
|
383
|
+
function jt(e, t) {
|
|
384
|
+
let n = Mt(e, t);
|
|
383
385
|
for (;;) {
|
|
384
|
-
let r =
|
|
386
|
+
let r = wt(e);
|
|
385
387
|
if (!r || r.kind !== "op" || r.text !== "*" && r.text !== "/") break;
|
|
386
|
-
|
|
387
|
-
let i =
|
|
388
|
-
if (r.text === "*") n =
|
|
388
|
+
Tt(e);
|
|
389
|
+
let i = Mt(e, t);
|
|
390
|
+
if (r.text === "*") n = X(n) * X(i);
|
|
389
391
|
else {
|
|
390
|
-
let e =
|
|
391
|
-
n = e === 0 ? 0 :
|
|
392
|
+
let e = X(i);
|
|
393
|
+
n = e === 0 ? 0 : X(n) / e;
|
|
392
394
|
}
|
|
393
395
|
}
|
|
394
396
|
return n;
|
|
395
397
|
}
|
|
396
|
-
function jt(e, t) {
|
|
397
|
-
let n = Ct(e);
|
|
398
|
-
return n && n.kind === "op" && n.text === "-" ? (wt(e), -Z(jt(e, t))) : n && n.kind === "op" && n.text === "+" ? (wt(e), Z(jt(e, t))) : Mt(e, t);
|
|
399
|
-
}
|
|
400
398
|
function Mt(e, t) {
|
|
401
399
|
let n = wt(e);
|
|
400
|
+
return n && n.kind === "op" && n.text === "-" ? (Tt(e), -X(Mt(e, t))) : n && n.kind === "op" && n.text === "+" ? (Tt(e), X(Mt(e, t))) : Nt(e, t);
|
|
401
|
+
}
|
|
402
|
+
function Nt(e, t) {
|
|
403
|
+
let n = Tt(e);
|
|
402
404
|
if (!n) return 0;
|
|
403
405
|
if (n.kind === "num") return parseFloat(n.text);
|
|
404
406
|
if (n.kind === "str") return n.text;
|
|
405
407
|
if (n.kind === "bool") return n.text === "TRUE";
|
|
406
408
|
if (n.kind === "lparen") {
|
|
407
|
-
let n =
|
|
409
|
+
let n = Et(e, t), r = Tt(e);
|
|
408
410
|
if (!r || r.kind !== "rparen") throw Error("missing )");
|
|
409
411
|
return n;
|
|
410
412
|
}
|
|
411
413
|
if (n.kind === "ref") {
|
|
412
|
-
if (
|
|
413
|
-
|
|
414
|
-
let r =
|
|
414
|
+
if (wt(e)?.kind === "colon") {
|
|
415
|
+
Tt(e);
|
|
416
|
+
let r = Tt(e);
|
|
415
417
|
if (r?.kind !== "ref" || !r.ref) throw Error("range: expected ref after :");
|
|
416
|
-
return
|
|
418
|
+
return It(n.ref, r.ref, t);
|
|
417
419
|
}
|
|
418
|
-
return
|
|
420
|
+
return Ft(n.ref, t);
|
|
419
421
|
}
|
|
420
422
|
if (n.kind === "name") {
|
|
421
|
-
if (
|
|
422
|
-
|
|
423
|
+
if (wt(e)?.kind === "lparen") {
|
|
424
|
+
Tt(e);
|
|
423
425
|
let r = [];
|
|
424
|
-
if (
|
|
425
|
-
let i =
|
|
426
|
+
if (wt(e)?.kind !== "rparen") for (r.push(Et(e, t)); wt(e)?.kind === "comma";) Tt(e), r.push(Et(e, t));
|
|
427
|
+
let i = Tt(e);
|
|
426
428
|
if (!i || i.kind !== "rparen") throw Error("missing )");
|
|
427
|
-
return
|
|
429
|
+
return Rt(n.text, r, t);
|
|
428
430
|
}
|
|
429
431
|
let r = t.definedNames.get(n.text);
|
|
430
|
-
return r && t.depth <
|
|
432
|
+
return r && t.depth < ht ? Ct(Pt(r.formula), {
|
|
431
433
|
...t,
|
|
432
434
|
anchorRow: 1,
|
|
433
435
|
anchorCol: 1,
|
|
@@ -436,20 +438,20 @@ function Mt(e, t) {
|
|
|
436
438
|
}
|
|
437
439
|
return 0;
|
|
438
440
|
}
|
|
439
|
-
function
|
|
441
|
+
function Pt(e) {
|
|
440
442
|
let t = e.match(/^(?:'[^']*'|[A-Za-z_][A-Za-z0-9_.]*)!(.*)$/);
|
|
441
443
|
return t ? t[1] : e;
|
|
442
444
|
}
|
|
443
|
-
function
|
|
445
|
+
function Ft(e, t) {
|
|
444
446
|
let n = e.colAbs ? e.col : e.col + (t.col - t.anchorCol), r = e.rowAbs ? e.row : e.row + (t.row - t.anchorRow);
|
|
445
|
-
return
|
|
447
|
+
return Lt(t.cellIndex.get(`${r}:${n}`));
|
|
446
448
|
}
|
|
447
|
-
function
|
|
449
|
+
function It(e, t, n) {
|
|
448
450
|
let r = e.colAbs ? e.col : e.col + (n.col - n.anchorCol), i = e.rowAbs ? e.row : e.row + (n.row - n.anchorRow), a = t.colAbs ? t.col : t.col + (n.col - n.anchorCol), o = t.rowAbs ? t.row : t.row + (n.row - n.anchorRow), s = Math.min(r, a), c = Math.max(r, a), l = Math.min(i, o), u = Math.max(i, o), d = [], f = 4096;
|
|
449
|
-
for (let e = l; e <= u && d.length < f; e++) for (let t = s; t <= c && d.length < f; t++) d.push(
|
|
451
|
+
for (let e = l; e <= u && d.length < f; e++) for (let t = s; t <= c && d.length < f; t++) d.push(Lt(n.cellIndex.get(`${e}:${t}`)));
|
|
450
452
|
return d;
|
|
451
453
|
}
|
|
452
|
-
function
|
|
454
|
+
function Lt(e) {
|
|
453
455
|
if (!e) return null;
|
|
454
456
|
switch (e.value.type) {
|
|
455
457
|
case "number": return e.value.number;
|
|
@@ -459,162 +461,162 @@ function It(e) {
|
|
|
459
461
|
default: return null;
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
|
-
function
|
|
464
|
+
function Rt(e, t, n) {
|
|
463
465
|
switch (e.toUpperCase()) {
|
|
464
|
-
case "AND": return t.flatMap(
|
|
465
|
-
case "OR": return t.flatMap(
|
|
466
|
-
case "NOT": return !
|
|
467
|
-
case "IF": return
|
|
466
|
+
case "AND": return t.flatMap(Y).every((e) => _t(e));
|
|
467
|
+
case "OR": return t.flatMap(Y).some((e) => _t(e));
|
|
468
|
+
case "NOT": return !_t(t[0]);
|
|
469
|
+
case "IF": return _t(t[0]) ? t[1] ?? !0 : t[2] ?? !1;
|
|
468
470
|
case "IFERROR": return t[0] == null ? t[1] ?? 0 : t[0];
|
|
469
471
|
case "IFS":
|
|
470
|
-
for (let e = 0; e + 1 < t.length; e += 2) if (
|
|
472
|
+
for (let e = 0; e + 1 < t.length; e += 2) if (_t(t[e])) return t[e + 1];
|
|
471
473
|
return null;
|
|
472
474
|
case "TRUE": return !0;
|
|
473
475
|
case "FALSE": return !1;
|
|
474
476
|
case "ISBLANK": {
|
|
475
|
-
let e =
|
|
477
|
+
let e = mt(t[0]);
|
|
476
478
|
return e == null || e === "";
|
|
477
479
|
}
|
|
478
|
-
case "ISNUMBER": return typeof
|
|
479
|
-
case "ISTEXT": return typeof
|
|
480
|
-
case "ISNONTEXT": return typeof
|
|
480
|
+
case "ISNUMBER": return typeof mt(t[0]) == "number";
|
|
481
|
+
case "ISTEXT": return typeof mt(t[0]) == "string";
|
|
482
|
+
case "ISNONTEXT": return typeof mt(t[0]) != "string";
|
|
481
483
|
case "ISERROR":
|
|
482
484
|
case "ISERR":
|
|
483
|
-
case "ISNA": return
|
|
484
|
-
case "ISLOGICAL": return typeof
|
|
485
|
+
case "ISNA": return mt(t[0]) == null;
|
|
486
|
+
case "ISLOGICAL": return typeof mt(t[0]) == "boolean";
|
|
485
487
|
case "ROUNDDOWN": {
|
|
486
|
-
let e =
|
|
488
|
+
let e = X(t[0]), n = 10 ** X(t[1]);
|
|
487
489
|
return (e >= 0 ? Math.floor(e * n) : Math.ceil(e * n)) / n;
|
|
488
490
|
}
|
|
489
491
|
case "ROUNDUP": {
|
|
490
|
-
let e =
|
|
492
|
+
let e = X(t[0]), n = 10 ** X(t[1]);
|
|
491
493
|
return (e >= 0 ? Math.ceil(e * n) : Math.floor(e * n)) / n;
|
|
492
494
|
}
|
|
493
495
|
case "ROUND": {
|
|
494
|
-
let e =
|
|
496
|
+
let e = X(t[0]), n = 10 ** X(t[1]);
|
|
495
497
|
return Math.round(e * n) / n;
|
|
496
498
|
}
|
|
497
|
-
case "INT": return Math.floor(
|
|
499
|
+
case "INT": return Math.floor(X(t[0]));
|
|
498
500
|
case "TRUNC": {
|
|
499
|
-
let e =
|
|
501
|
+
let e = X(t[0]), n = 10 ** X(t[1] ?? 0);
|
|
500
502
|
return (e >= 0 ? Math.floor(e * n) : Math.ceil(e * n)) / n;
|
|
501
503
|
}
|
|
502
504
|
case "CEILING": {
|
|
503
|
-
let e =
|
|
505
|
+
let e = X(t[0]), n = X(t[1] ?? 1);
|
|
504
506
|
return n === 0 ? 0 : Math.ceil(e / n) * n;
|
|
505
507
|
}
|
|
506
508
|
case "FLOOR": {
|
|
507
|
-
let e =
|
|
509
|
+
let e = X(t[0]), n = X(t[1] ?? 1);
|
|
508
510
|
return n === 0 ? 0 : Math.floor(e / n) * n;
|
|
509
511
|
}
|
|
510
512
|
case "MOD": {
|
|
511
|
-
let e =
|
|
513
|
+
let e = X(t[0]), n = X(t[1]);
|
|
512
514
|
return n === 0 ? null : e - Math.floor(e / n) * n;
|
|
513
515
|
}
|
|
514
|
-
case "POWER": return
|
|
516
|
+
case "POWER": return X(t[0]) ** +X(t[1]);
|
|
515
517
|
case "SQRT": {
|
|
516
|
-
let e =
|
|
518
|
+
let e = X(t[0]);
|
|
517
519
|
return e < 0 ? null : Math.sqrt(e);
|
|
518
520
|
}
|
|
519
|
-
case "ABS": return Math.abs(
|
|
521
|
+
case "ABS": return Math.abs(X(t[0]));
|
|
520
522
|
case "SIGN": {
|
|
521
|
-
let e =
|
|
523
|
+
let e = X(t[0]);
|
|
522
524
|
return e > 0 ? 1 : e < 0 ? -1 : 0;
|
|
523
525
|
}
|
|
524
|
-
case "EXP": return Math.exp(
|
|
526
|
+
case "EXP": return Math.exp(X(t[0]));
|
|
525
527
|
case "LN": {
|
|
526
|
-
let e =
|
|
528
|
+
let e = X(t[0]);
|
|
527
529
|
return e <= 0 ? null : Math.log(e);
|
|
528
530
|
}
|
|
529
531
|
case "LOG10": {
|
|
530
|
-
let e =
|
|
532
|
+
let e = X(t[0]);
|
|
531
533
|
return e <= 0 ? null : Math.log10(e);
|
|
532
534
|
}
|
|
533
535
|
case "MIN": {
|
|
534
|
-
let e = t.flatMap(
|
|
536
|
+
let e = t.flatMap(Y).filter((e) => typeof e == "number");
|
|
535
537
|
return e.length ? Math.min(...e) : 0;
|
|
536
538
|
}
|
|
537
539
|
case "MAX": {
|
|
538
|
-
let e = t.flatMap(
|
|
540
|
+
let e = t.flatMap(Y).filter((e) => typeof e == "number");
|
|
539
541
|
return e.length ? Math.max(...e) : 0;
|
|
540
542
|
}
|
|
541
|
-
case "SUM": return t.flatMap(
|
|
543
|
+
case "SUM": return t.flatMap(Y).reduce((e, t) => e + (typeof t == "number" ? t : 0), 0);
|
|
542
544
|
case "AVERAGE": {
|
|
543
|
-
let e = t.flatMap(
|
|
545
|
+
let e = t.flatMap(Y).filter((e) => typeof e == "number");
|
|
544
546
|
return e.length ? e.reduce((e, t) => e + t, 0) / e.length : null;
|
|
545
547
|
}
|
|
546
|
-
case "COUNT": return t.flatMap(
|
|
547
|
-
case "COUNTA": return t.flatMap(
|
|
548
|
-
case "COUNTBLANK": return t.flatMap(
|
|
549
|
-
case "COUNTIF": return
|
|
550
|
-
case "SUMIF": return
|
|
548
|
+
case "COUNT": return t.flatMap(Y).filter((e) => typeof e == "number").length;
|
|
549
|
+
case "COUNTA": return t.flatMap(Y).filter((e) => e != null && e !== "").length;
|
|
550
|
+
case "COUNTBLANK": return t.flatMap(Y).filter((e) => e == null || e === "").length;
|
|
551
|
+
case "COUNTIF": return zt(Y(t[0]), t[1]);
|
|
552
|
+
case "SUMIF": return Bt(Y(t[0]), t[1], t[2] === void 0 ? null : Y(t[2]));
|
|
551
553
|
case "AVERAGEIF": {
|
|
552
|
-
let e =
|
|
553
|
-
return r === 0 ? null :
|
|
554
|
+
let e = Y(t[0]), n = Bt(e, t[1], t[2] === void 0 ? null : Y(t[2])), r = zt(e, t[1]);
|
|
555
|
+
return r === 0 ? null : X(n) / r;
|
|
554
556
|
}
|
|
555
|
-
case "LEN": return
|
|
556
|
-
case "LEFT": return
|
|
557
|
+
case "LEN": return Z(t[0]).length;
|
|
558
|
+
case "LEFT": return Z(t[0]).slice(0, Math.max(0, X(t[1] ?? 1)));
|
|
557
559
|
case "RIGHT": {
|
|
558
|
-
let e =
|
|
560
|
+
let e = Z(t[0]), n = Math.max(0, X(t[1] ?? 1));
|
|
559
561
|
return n >= e.length ? e : e.slice(e.length - n);
|
|
560
562
|
}
|
|
561
563
|
case "MID": {
|
|
562
|
-
let e =
|
|
564
|
+
let e = Z(t[0]), n = Math.max(1, X(t[1])) - 1, r = Math.max(0, X(t[2]));
|
|
563
565
|
return e.slice(n, n + r);
|
|
564
566
|
}
|
|
565
|
-
case "UPPER": return
|
|
566
|
-
case "LOWER": return
|
|
567
|
-
case "TRIM": return
|
|
568
|
-
case "EXACT": return
|
|
567
|
+
case "UPPER": return Z(t[0]).toUpperCase();
|
|
568
|
+
case "LOWER": return Z(t[0]).toLowerCase();
|
|
569
|
+
case "TRIM": return Z(t[0]).replace(/\s+/g, " ").trim();
|
|
570
|
+
case "EXACT": return Z(t[0]) === Z(t[1]);
|
|
569
571
|
case "FIND": {
|
|
570
|
-
let e =
|
|
572
|
+
let e = Z(t[0]), n = Z(t[1]), r = Math.max(1, X(t[2] ?? 1)) - 1, i = n.indexOf(e, r);
|
|
571
573
|
return i < 0 ? null : i + 1;
|
|
572
574
|
}
|
|
573
575
|
case "SEARCH": {
|
|
574
|
-
let e =
|
|
576
|
+
let e = Z(t[0]).toLowerCase(), n = Z(t[1]).toLowerCase(), r = Math.max(1, X(t[2] ?? 1)) - 1, i = n.indexOf(e, r);
|
|
575
577
|
return i < 0 ? null : i + 1;
|
|
576
578
|
}
|
|
577
579
|
case "CONCATENATE":
|
|
578
|
-
case "CONCAT": return t.flatMap(
|
|
580
|
+
case "CONCAT": return t.flatMap(Y).map((e) => e == null ? "" : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : String(e)).join("");
|
|
579
581
|
case "T": {
|
|
580
|
-
let e =
|
|
582
|
+
let e = mt(t[0]);
|
|
581
583
|
return typeof e == "string" ? e : "";
|
|
582
584
|
}
|
|
583
585
|
case "N": {
|
|
584
|
-
let e =
|
|
586
|
+
let e = mt(t[0]);
|
|
585
587
|
return typeof e == "number" ? e : typeof e == "boolean" ? +!!e : 0;
|
|
586
588
|
}
|
|
587
|
-
case "VALUE": return
|
|
589
|
+
case "VALUE": return X(t[0]);
|
|
588
590
|
case "ROW": return n.row;
|
|
589
591
|
case "COLUMN": return n.col;
|
|
590
|
-
case "TODAY": return
|
|
591
|
-
case "NOW": return
|
|
592
|
-
case "DATE": return
|
|
593
|
-
case "YEAR": return
|
|
594
|
-
case "MONTH": return
|
|
595
|
-
case "DAY": return
|
|
592
|
+
case "TODAY": return Ht();
|
|
593
|
+
case "NOW": return Ut();
|
|
594
|
+
case "DATE": return Wt(X(t[0]), X(t[1]), X(t[2]));
|
|
595
|
+
case "YEAR": return Kt(X(t[0])).y;
|
|
596
|
+
case "MONTH": return Kt(X(t[0])).m;
|
|
597
|
+
case "DAY": return Kt(X(t[0])).d;
|
|
596
598
|
case "WEEKDAY": {
|
|
597
|
-
let e =
|
|
599
|
+
let e = Gt(X(t[0])).getUTCDay(), n = X(t[1] ?? 1);
|
|
598
600
|
return n === 2 ? e === 0 ? 7 : e : n === 3 ? e === 0 ? 6 : e - 1 : e + 1;
|
|
599
601
|
}
|
|
600
602
|
default: return 0;
|
|
601
603
|
}
|
|
602
604
|
}
|
|
603
|
-
function
|
|
604
|
-
let n =
|
|
605
|
+
function zt(e, t) {
|
|
606
|
+
let n = Vt(t), r = 0;
|
|
605
607
|
for (let t of e) n(t) && r++;
|
|
606
608
|
return r;
|
|
607
609
|
}
|
|
608
|
-
function
|
|
609
|
-
let r =
|
|
610
|
+
function Bt(e, t, n) {
|
|
611
|
+
let r = Vt(t), i = n ?? e, a = 0;
|
|
610
612
|
for (let t = 0; t < e.length; t++) if (r(e[t])) {
|
|
611
613
|
let e = i[t];
|
|
612
614
|
typeof e == "number" && (a += e);
|
|
613
615
|
}
|
|
614
616
|
return a;
|
|
615
617
|
}
|
|
616
|
-
function
|
|
617
|
-
let t =
|
|
618
|
+
function Vt(e) {
|
|
619
|
+
let t = mt(e);
|
|
618
620
|
if (typeof t != "string") {
|
|
619
621
|
let e = typeof t == "number" ? t : null;
|
|
620
622
|
return (n) => e !== null && typeof n == "number" ? n === e : n === t;
|
|
@@ -640,21 +642,21 @@ function Bt(e) {
|
|
|
640
642
|
}
|
|
641
643
|
};
|
|
642
644
|
}
|
|
643
|
-
function Vt() {
|
|
644
|
-
let e = /* @__PURE__ */ new Date();
|
|
645
|
-
return de(new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), !1);
|
|
646
|
-
}
|
|
647
645
|
function Ht() {
|
|
648
|
-
|
|
646
|
+
let e = /* @__PURE__ */ new Date();
|
|
647
|
+
return Le(new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), !1);
|
|
649
648
|
}
|
|
650
|
-
function Ut(
|
|
651
|
-
return
|
|
649
|
+
function Ut() {
|
|
650
|
+
return Le(new Date(Date.now()), !1);
|
|
652
651
|
}
|
|
653
|
-
function Wt(e) {
|
|
654
|
-
return
|
|
652
|
+
function Wt(e, t, n) {
|
|
653
|
+
return Math.floor(Le(new Date(Date.UTC(e, t - 1, n)), !1));
|
|
655
654
|
}
|
|
656
655
|
function Gt(e) {
|
|
657
|
-
|
|
656
|
+
return Fe(Math.floor(e), !1);
|
|
657
|
+
}
|
|
658
|
+
function Kt(e) {
|
|
659
|
+
let t = Gt(e);
|
|
658
660
|
return {
|
|
659
661
|
y: t.getUTCFullYear(),
|
|
660
662
|
m: t.getUTCMonth() + 1,
|
|
@@ -663,9 +665,9 @@ function Gt(e) {
|
|
|
663
665
|
}
|
|
664
666
|
//#endregion
|
|
665
667
|
//#region packages/xlsx/src/number-format.ts
|
|
666
|
-
var
|
|
667
|
-
function
|
|
668
|
-
let t = e ?? "", n =
|
|
668
|
+
var qt = /* @__PURE__ */ new Map();
|
|
669
|
+
function Jt(e) {
|
|
670
|
+
let t = e ?? "", n = qt.get(t);
|
|
669
671
|
if (n) return n;
|
|
670
672
|
let r = new Intl.DateTimeFormat(e, {
|
|
671
673
|
year: "numeric",
|
|
@@ -673,9 +675,9 @@ function qt(e) {
|
|
|
673
675
|
day: "numeric",
|
|
674
676
|
timeZone: "UTC"
|
|
675
677
|
});
|
|
676
|
-
return
|
|
678
|
+
return qt.set(t, r), r;
|
|
677
679
|
}
|
|
678
|
-
function
|
|
680
|
+
function Yt(e) {
|
|
679
681
|
switch (e.type) {
|
|
680
682
|
case "empty": return "";
|
|
681
683
|
case "text": return e.text;
|
|
@@ -685,20 +687,20 @@ function Jt(e) {
|
|
|
685
687
|
case "shared": return "";
|
|
686
688
|
}
|
|
687
689
|
}
|
|
688
|
-
function Yt(e, t, n, r = !1) {
|
|
689
|
-
return Xt(e, t, n, r).text;
|
|
690
|
-
}
|
|
691
690
|
function Xt(e, t, n, r = !1) {
|
|
691
|
+
return Zt(e, t, n, r).text;
|
|
692
|
+
}
|
|
693
|
+
function Zt(e, t, n, r = !1) {
|
|
692
694
|
let i = t.cellXfs[e.styleIndex ?? 0]?.numFmtId ?? 0, a = t.numFmts?.find((e) => e.numFmtId === i)?.formatCode ?? null, o = n?.numFmtId ?? i, s = n?.formatCode ?? a;
|
|
693
695
|
if (e.value.type !== "number") {
|
|
694
|
-
let t =
|
|
695
|
-
return { text: s ?
|
|
696
|
+
let t = Yt(e.value);
|
|
697
|
+
return { text: s ? Qt(t, s) : t };
|
|
696
698
|
}
|
|
697
|
-
let c =
|
|
698
|
-
return
|
|
699
|
+
let c = $t(e.formula);
|
|
700
|
+
return gn(c ?? e.value.number, o, s, c === null ? r : !1);
|
|
699
701
|
}
|
|
700
|
-
function
|
|
701
|
-
let n =
|
|
702
|
+
function Qt(e, t) {
|
|
703
|
+
let n = yn(t), r;
|
|
702
704
|
if (n.length >= 4) r = n[3];
|
|
703
705
|
else {
|
|
704
706
|
let t = n[n.length - 1];
|
|
@@ -720,12 +722,12 @@ function Zt(e, t) {
|
|
|
720
722
|
}
|
|
721
723
|
return i;
|
|
722
724
|
}
|
|
723
|
-
function
|
|
725
|
+
function $t(e) {
|
|
724
726
|
if (!e) return null;
|
|
725
727
|
let t = e.trim().replace(/^=/, "").toUpperCase().replace(/\s+/g, "");
|
|
726
|
-
return t === "TODAY()" ?
|
|
728
|
+
return t === "TODAY()" ? Ht() : t === "NOW()" ? Ut() : null;
|
|
727
729
|
}
|
|
728
|
-
var
|
|
730
|
+
var en = {
|
|
729
731
|
15: "d-mmm-yy",
|
|
730
732
|
16: "d-mmm",
|
|
731
733
|
17: "mmm-yy",
|
|
@@ -748,7 +750,7 @@ var $t = {
|
|
|
748
750
|
56: "m\"月\"d\"日\"",
|
|
749
751
|
57: "[$-411]ge.m.d",
|
|
750
752
|
58: "[$-411]ggge\"年\"m\"月\"d\"日\""
|
|
751
|
-
},
|
|
753
|
+
}, tn = [
|
|
752
754
|
"January",
|
|
753
755
|
"February",
|
|
754
756
|
"March",
|
|
@@ -761,7 +763,7 @@ var $t = {
|
|
|
761
763
|
"October",
|
|
762
764
|
"November",
|
|
763
765
|
"December"
|
|
764
|
-
],
|
|
766
|
+
], nn = [
|
|
765
767
|
"Sunday",
|
|
766
768
|
"Monday",
|
|
767
769
|
"Tuesday",
|
|
@@ -769,7 +771,7 @@ var $t = {
|
|
|
769
771
|
"Thursday",
|
|
770
772
|
"Friday",
|
|
771
773
|
"Saturday"
|
|
772
|
-
],
|
|
774
|
+
], rn = [
|
|
773
775
|
"日",
|
|
774
776
|
"月",
|
|
775
777
|
"火",
|
|
@@ -777,7 +779,7 @@ var $t = {
|
|
|
777
779
|
"木",
|
|
778
780
|
"金",
|
|
779
781
|
"土"
|
|
780
|
-
],
|
|
782
|
+
], an = [
|
|
781
783
|
"日曜日",
|
|
782
784
|
"月曜日",
|
|
783
785
|
"火曜日",
|
|
@@ -785,7 +787,7 @@ var $t = {
|
|
|
785
787
|
"木曜日",
|
|
786
788
|
"金曜日",
|
|
787
789
|
"土曜日"
|
|
788
|
-
],
|
|
790
|
+
], on = [
|
|
789
791
|
{
|
|
790
792
|
start: new Date(Date.UTC(2019, 4, 1)),
|
|
791
793
|
abbr: "R",
|
|
@@ -817,14 +819,14 @@ var $t = {
|
|
|
817
819
|
long: "明治"
|
|
818
820
|
}
|
|
819
821
|
];
|
|
820
|
-
function
|
|
821
|
-
for (let t of
|
|
822
|
+
function sn(e) {
|
|
823
|
+
for (let t of on) if (e.getTime() >= t.start.getTime()) return {
|
|
822
824
|
abbr: t.abbr,
|
|
823
825
|
short: t.short,
|
|
824
826
|
long: t.long,
|
|
825
827
|
year: e.getUTCFullYear() - t.start.getUTCFullYear() + 1
|
|
826
828
|
};
|
|
827
|
-
let t =
|
|
829
|
+
let t = on[on.length - 1];
|
|
828
830
|
return {
|
|
829
831
|
abbr: t.abbr,
|
|
830
832
|
short: t.short,
|
|
@@ -832,8 +834,8 @@ function on(e) {
|
|
|
832
834
|
year: e.getUTCFullYear()
|
|
833
835
|
};
|
|
834
836
|
}
|
|
835
|
-
function
|
|
836
|
-
let r =
|
|
837
|
+
function cn(e, t, n = !1) {
|
|
838
|
+
let r = Fe(e, n), i = r.getUTCFullYear(), a = r.getUTCMonth() + 1, o = r.getUTCDate(), s = r.getUTCDay(), c = r.getUTCHours(), l = r.getUTCMinutes(), u = r.getUTCSeconds(), d = t.split(";")[0], f = /am\/pm|a\/p/i.test(d), p = null, m = () => p ??= sn(r), h = "", g = 0, _ = !1;
|
|
837
839
|
for (; g < d.length;) {
|
|
838
840
|
let t = d[g];
|
|
839
841
|
if (t === "\"") {
|
|
@@ -861,11 +863,11 @@ function sn(e, t, n = !1) {
|
|
|
861
863
|
let e = 0;
|
|
862
864
|
for (; g < d.length && d[g].toLowerCase() === "m";) e++, g++;
|
|
863
865
|
let t = d.slice(g).replace(/\[[^\]]*\]/g, "");
|
|
864
|
-
_ || /^:s/i.test(t) ? h += e >= 2 ? String(l).padStart(2, "0") : String(l) : e === 1 ? h += String(a) : e === 2 ? h += String(a).padStart(2, "0") : e === 3 ? h +=
|
|
866
|
+
_ || /^:s/i.test(t) ? h += e >= 2 ? String(l).padStart(2, "0") : String(l) : e === 1 ? h += String(a) : e === 2 ? h += String(a).padStart(2, "0") : e === 3 ? h += tn[a - 1].slice(0, 3) : e === 4 ? h += tn[a - 1] : h += tn[a - 1][0], _ = !1;
|
|
865
867
|
} else if (t === "d" || t === "D") {
|
|
866
868
|
let e = 0;
|
|
867
869
|
for (; g < d.length && d[g].toLowerCase() === "d";) e++, g++;
|
|
868
|
-
e === 1 ? h += String(o) : e === 2 ? h += String(o).padStart(2, "0") : e === 3 ? h +=
|
|
870
|
+
e === 1 ? h += String(o) : e === 2 ? h += String(o).padStart(2, "0") : e === 3 ? h += nn[s].slice(0, 3) : h += nn[s], _ = !1;
|
|
869
871
|
} else if (t === "h" || t === "H") {
|
|
870
872
|
let e = 0;
|
|
871
873
|
for (; g < d.length && d[g].toLowerCase() === "h";) e++, g++;
|
|
@@ -892,61 +894,61 @@ function sn(e, t, n = !1) {
|
|
|
892
894
|
h += e >= 2 ? String(t).padStart(2, "0") : String(t), _ = !1;
|
|
893
895
|
} else if (t === "A" || t === "a") {
|
|
894
896
|
let e = d.slice(g).toUpperCase();
|
|
895
|
-
e.startsWith("AAAA") ? (h +=
|
|
897
|
+
e.startsWith("AAAA") ? (h += an[s], g += 4) : e.startsWith("AAA") ? (h += rn[s], g += 3) : e.startsWith("AM/PM") ? (h += c < 12 ? "AM" : "PM", g += 5) : e.startsWith("A/P") ? (h += c < 12 ? "A" : "P", g += 3) : (h += t, g++), _ = !1;
|
|
896
898
|
} else h += t, g++, t !== ":" && t !== "/" && t !== "-" && t !== "." && t !== " " && (_ = !1);
|
|
897
899
|
}
|
|
898
900
|
return h;
|
|
899
901
|
}
|
|
900
|
-
function
|
|
902
|
+
function ln(e) {
|
|
901
903
|
if (/\[[hms]+\]/i.test(e)) return !0;
|
|
902
904
|
let t = e.replace(/"[^"]*"/g, "").replace(/\[[^\]]*\]/g, "");
|
|
903
905
|
return /[yd]/i.test(t) || /a{3,}/i.test(t);
|
|
904
906
|
}
|
|
905
|
-
var
|
|
906
|
-
function dn(e) {
|
|
907
|
-
return e.includes(".") ? e.replace(/0+$/, "").replace(/\.$/, "") : e;
|
|
908
|
-
}
|
|
907
|
+
var un = 11, dn = 6;
|
|
909
908
|
function fn(e) {
|
|
910
|
-
return
|
|
909
|
+
return e.includes(".") ? e.replace(/0+$/, "").replace(/\.$/, "") : e;
|
|
911
910
|
}
|
|
912
911
|
function pn(e) {
|
|
913
|
-
|
|
914
|
-
return `${dn(t)}E${fn(Number(n))}`;
|
|
912
|
+
return `${e >= 0 ? "+" : "-"}${Math.abs(e).toString().padStart(2, "0")}`;
|
|
915
913
|
}
|
|
916
914
|
function mn(e) {
|
|
915
|
+
let [t, n] = e.toExponential(dn - 1).split("e");
|
|
916
|
+
return `${fn(t)}E${pn(Number(n))}`;
|
|
917
|
+
}
|
|
918
|
+
function hn(e) {
|
|
917
919
|
if (!Number.isFinite(e)) return String(e);
|
|
918
920
|
if (e === 0) return "0";
|
|
919
|
-
let t = e < 0, n = Math.abs(e), r = Number(n.toExponential(
|
|
921
|
+
let t = e < 0, n = Math.abs(e), r = Number(n.toExponential(un - 1).split("e")[1]), i = r >= un || r < -5 ? mn(n) : fn(n.toPrecision(un));
|
|
920
922
|
return t ? `-${i}` : i;
|
|
921
923
|
}
|
|
922
|
-
function
|
|
924
|
+
function gn(e, t, n, r = !1) {
|
|
923
925
|
if (t === 14 && !n) {
|
|
924
|
-
let t = typeof navigator > "u" ? void 0 : navigator.language, n =
|
|
925
|
-
return { text:
|
|
926
|
+
let t = typeof navigator > "u" ? void 0 : navigator.language, n = Fe(e, r);
|
|
927
|
+
return { text: Jt(t).format(n) };
|
|
926
928
|
}
|
|
927
|
-
let i =
|
|
928
|
-
if (i) return { text:
|
|
929
|
-
if (n && n.trim().toLowerCase() === "general") return { text:
|
|
930
|
-
if (n) return
|
|
929
|
+
let i = en[t];
|
|
930
|
+
if (i) return { text: cn(e, i, r) };
|
|
931
|
+
if (n && n.trim().toLowerCase() === "general") return { text: hn(e) };
|
|
932
|
+
if (n) return ln(n) ? { text: cn(e, n, r) } : kn(e, n);
|
|
931
933
|
switch (t) {
|
|
932
|
-
case 0: return { text:
|
|
933
|
-
case 1: return
|
|
934
|
-
case 2: return
|
|
935
|
-
case 3: return
|
|
936
|
-
case 4: return
|
|
937
|
-
case 9: return
|
|
938
|
-
case 10: return
|
|
939
|
-
case 11: return
|
|
940
|
-
case 37: return
|
|
941
|
-
case 38: return
|
|
942
|
-
case 39: return
|
|
943
|
-
case 40: return
|
|
944
|
-
case 48: return
|
|
934
|
+
case 0: return { text: hn(e) };
|
|
935
|
+
case 1: return kn(e, "0");
|
|
936
|
+
case 2: return kn(e, "0.00");
|
|
937
|
+
case 3: return kn(e, "#,##0");
|
|
938
|
+
case 4: return kn(e, "#,##0.00");
|
|
939
|
+
case 9: return kn(e, "0%");
|
|
940
|
+
case 10: return kn(e, "0.00%");
|
|
941
|
+
case 11: return kn(e, "0.00E+00");
|
|
942
|
+
case 37: return kn(e, "#,##0 ;(#,##0)");
|
|
943
|
+
case 38: return kn(e, "#,##0 ;[Red](#,##0)");
|
|
944
|
+
case 39: return kn(e, "#,##0.00;(#,##0.00)");
|
|
945
|
+
case 40: return kn(e, "#,##0.00;[Red](#,##0.00)");
|
|
946
|
+
case 48: return kn(e, "##0.0E+0");
|
|
945
947
|
case 49: return { text: String(e) };
|
|
946
|
-
default: return { text:
|
|
948
|
+
default: return { text: hn(e) };
|
|
947
949
|
}
|
|
948
950
|
}
|
|
949
|
-
var
|
|
951
|
+
var _n = {
|
|
950
952
|
black: "#000000",
|
|
951
953
|
blue: "#0000FF",
|
|
952
954
|
cyan: "#00FFFF",
|
|
@@ -955,8 +957,8 @@ var gn = {
|
|
|
955
957
|
red: "#FF0000",
|
|
956
958
|
white: "#FFFFFF",
|
|
957
959
|
yellow: "#FFFF00"
|
|
958
|
-
},
|
|
959
|
-
function
|
|
960
|
+
}, vn = /* @__PURE__ */ "#000000.#FFFFFF.#FF0000.#00FF00.#0000FF.#FFFF00.#FF00FF.#00FFFF.#000000.#FFFFFF.#FF0000.#00FF00.#0000FF.#FFFF00.#FF00FF.#00FFFF.#800000.#008000.#000080.#808000.#800080.#008080.#C0C0C0.#808080.#9999FF.#993366.#FFFFCC.#CCFFFF.#660066.#FF8080.#0066CC.#CCCCFF.#000080.#FF00FF.#FFFF00.#00FFFF.#800080.#800000.#008080.#0000FF.#00CCFF.#CCFFFF.#CCFFCC.#FFFF99.#99CCFF.#FF99CC.#CC99FF.#FFCC99.#3366FF.#33CCCC.#99CC00.#FFCC00.#FF9900.#FF6600.#666699.#969696.#003366.#339966.#003300.#333300.#993300.#993366.#333399.#333333".split(".");
|
|
961
|
+
function yn(e) {
|
|
960
962
|
let t = [], n = "", r = 0;
|
|
961
963
|
for (; r < e.length;) {
|
|
962
964
|
let i = e[r];
|
|
@@ -971,7 +973,7 @@ function vn(e) {
|
|
|
971
973
|
}
|
|
972
974
|
return t.push(n), t;
|
|
973
975
|
}
|
|
974
|
-
function
|
|
976
|
+
function bn(e) {
|
|
975
977
|
let t = "", n, r, i = 0;
|
|
976
978
|
for (; i < e.length;) {
|
|
977
979
|
let a = e[i];
|
|
@@ -986,10 +988,10 @@ function yn(e) {
|
|
|
986
988
|
continue;
|
|
987
989
|
}
|
|
988
990
|
let s = e.slice(i + 1, o), c = s.toLowerCase(), l = c.match(/^color(\d{1,2})$/), u = s.match(/^(<=|>=|<>|<|>|=)\s*(-?[0-9.]+(?:[eE][-+]?\d+)?)$/);
|
|
989
|
-
if (c in
|
|
991
|
+
if (c in _n) n = _n[c];
|
|
990
992
|
else if (l) {
|
|
991
993
|
let e = parseInt(l[1], 10);
|
|
992
|
-
e >= 1 && e <= 56 && (n =
|
|
994
|
+
e >= 1 && e <= 56 && (n = vn[e + 7] ?? n);
|
|
993
995
|
} else u ? r = {
|
|
994
996
|
op: u[1],
|
|
995
997
|
value: Number(u[2])
|
|
@@ -1003,7 +1005,7 @@ function yn(e) {
|
|
|
1003
1005
|
condition: r
|
|
1004
1006
|
};
|
|
1005
1007
|
}
|
|
1006
|
-
function
|
|
1008
|
+
function xn(e, t) {
|
|
1007
1009
|
switch (e.op) {
|
|
1008
1010
|
case "<": return t < e.value;
|
|
1009
1011
|
case "<=": return t <= e.value;
|
|
@@ -1013,7 +1015,7 @@ function bn(e, t) {
|
|
|
1013
1015
|
case "<>": return t !== e.value;
|
|
1014
1016
|
}
|
|
1015
1017
|
}
|
|
1016
|
-
function
|
|
1018
|
+
function Sn(e) {
|
|
1017
1019
|
let t = [], n = "", r = "", i = !1, a = !1, o, s = !1, c = 0, l = 0, u = (e) => {
|
|
1018
1020
|
if (!e) return;
|
|
1019
1021
|
!a && !s && (c = n.replace(/,/g, "").length);
|
|
@@ -1087,20 +1089,20 @@ function xn(e) {
|
|
|
1087
1089
|
fraction: h
|
|
1088
1090
|
};
|
|
1089
1091
|
}
|
|
1090
|
-
function
|
|
1092
|
+
function Cn(e) {
|
|
1091
1093
|
return e.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1092
1094
|
}
|
|
1093
|
-
function
|
|
1095
|
+
function wn(e, t, n) {
|
|
1094
1096
|
let r = t.split(""), i = e.split(""), a = [], o = i.length - 1, s = [];
|
|
1095
1097
|
for (let e = r.length - 1; e >= 0; e--) o >= 0 ? (a.unshift(i[o]), s.unshift(i[o]), o--) : r[e] === "0" ? (a.unshift("0"), s.unshift("0")) : r[e] === "?" && a.unshift(" ");
|
|
1096
1098
|
for (; o >= 0;) a.unshift(i[o]), s.unshift(i[o]), o--;
|
|
1097
1099
|
if (n) {
|
|
1098
|
-
let e =
|
|
1100
|
+
let e = Cn(s.join(""));
|
|
1099
1101
|
return (a.length - s.length > 0 ? a.slice(0, a.length - s.length).join("") : "") + e;
|
|
1100
1102
|
}
|
|
1101
1103
|
return a.join("");
|
|
1102
1104
|
}
|
|
1103
|
-
function
|
|
1105
|
+
function Tn(e, t) {
|
|
1104
1106
|
let n = t.length;
|
|
1105
1107
|
if (n === 0) return "";
|
|
1106
1108
|
let r = e.padEnd(n, "0").slice(0, n).split("");
|
|
@@ -1112,7 +1114,7 @@ function wn(e, t) {
|
|
|
1112
1114
|
}
|
|
1113
1115
|
return r.join("");
|
|
1114
1116
|
}
|
|
1115
|
-
function
|
|
1117
|
+
function En(e, t, n) {
|
|
1116
1118
|
if (n !== null) return [Math.round(e * n), n];
|
|
1117
1119
|
let r = 10 ** Math.max(t, 1) - 1, i = 0, a = 1, o = Math.abs(e), s = [0, 1], c = [1, 1];
|
|
1118
1120
|
for (let t = 0; t < 100; t++) {
|
|
@@ -1125,12 +1127,12 @@ function Tn(e, t, n) {
|
|
|
1125
1127
|
}
|
|
1126
1128
|
return [i, a];
|
|
1127
1129
|
}
|
|
1128
|
-
function
|
|
1129
|
-
let r =
|
|
1130
|
+
function Dn(e, t, n) {
|
|
1131
|
+
let r = Sn(t), i = n ? Math.abs(e) : e;
|
|
1130
1132
|
r.hasPercent && (i *= 100), r.commaScale > 0 && (i /= 1e3 ** r.commaScale);
|
|
1131
1133
|
let a = i < 0 ? "-" : "", o = Math.abs(i);
|
|
1132
1134
|
if (r.fraction) {
|
|
1133
|
-
let e = Math.floor(o), t = o - e, { wholeSpec: n, numSpec: i, denSpec: s, fixedDen: c } = r.fraction, l = n.length > 0, [u, d] =
|
|
1135
|
+
let e = Math.floor(o), t = o - e, { wholeSpec: n, numSpec: i, denSpec: s, fixedDen: c } = r.fraction, l = n.length > 0, [u, d] = En(t, s.length, c), f = (e, t) => {
|
|
1134
1136
|
let n = String(e), r = t.includes("0") ? "0" : " ";
|
|
1135
1137
|
for (; n.length < t.length;) n = r + n;
|
|
1136
1138
|
return n;
|
|
@@ -1156,14 +1158,14 @@ function En(e, t, n) {
|
|
|
1156
1158
|
}
|
|
1157
1159
|
if (r.exp) {
|
|
1158
1160
|
let e = Math.max(r.intSpec.length, 1), t = r.fracSpec.length, n = 0, i = 0;
|
|
1159
|
-
o !== 0 && (i = Math.floor(Math.log10(o)), i = Math.floor(i / e) * e, n = o / 10 ** i, parseFloat(
|
|
1160
|
-
let [s, c = ""] =
|
|
1161
|
-
return a +
|
|
1161
|
+
o !== 0 && (i = Math.floor(Math.log10(o)), i = Math.floor(i / e) * e, n = o / 10 ** i, parseFloat(Ie(n, t)) >= 10 ** e && (i += e, n = o / 10 ** i));
|
|
1162
|
+
let [s, c = ""] = Ie(n, t).split(".");
|
|
1163
|
+
return a + On(r, wn(s, r.intSpec, !1), Tn(c, r.fracSpec), "E" + (i < 0 ? "-" : r.exp.plus ? "+" : "") + String(Math.abs(i)).padStart(r.exp.width, "0"));
|
|
1162
1164
|
}
|
|
1163
|
-
let s = r.fracSpec.length, [c, l = ""] =
|
|
1164
|
-
return u === "" && d && (u = "0"), a +
|
|
1165
|
+
let s = r.fracSpec.length, [c, l = ""] = Ie(o, s).split("."), u = c.replace(/^0+/, ""), d = /[0]/.test(r.intSpec) || r.intSpec === "" && !1;
|
|
1166
|
+
return u === "" && d && (u = "0"), a + On(r, wn(u, r.intSpec, r.grouping), Tn(l, r.fracSpec), "");
|
|
1165
1167
|
}
|
|
1166
|
-
function
|
|
1168
|
+
function On(e, t, n, r) {
|
|
1167
1169
|
let i = t.split(""), a = [];
|
|
1168
1170
|
e.parts.forEach((e, t) => {
|
|
1169
1171
|
e.kind === "intph" && a.push(t);
|
|
@@ -1187,12 +1189,12 @@ function Dn(e, t, n, r) {
|
|
|
1187
1189
|
}
|
|
1188
1190
|
return f;
|
|
1189
1191
|
}
|
|
1190
|
-
function
|
|
1191
|
-
let n =
|
|
1192
|
+
function kn(e, t) {
|
|
1193
|
+
let n = yn(t).map(bn), r = n.some((e) => e.condition), i, a = !1;
|
|
1192
1194
|
if (r) {
|
|
1193
1195
|
let t = !1;
|
|
1194
1196
|
for (let r of n) if (r.condition) {
|
|
1195
|
-
if (
|
|
1197
|
+
if (xn(r.condition, e)) {
|
|
1196
1198
|
i = r, t = !0;
|
|
1197
1199
|
break;
|
|
1198
1200
|
}
|
|
@@ -1200,7 +1202,7 @@ function On(e, t) {
|
|
|
1200
1202
|
if (!i) return { text: "#" };
|
|
1201
1203
|
a = t && e < 0;
|
|
1202
1204
|
} else e > 0 ? i = n[0] : e < 0 ? n.length > 1 ? (i = n[1], a = !0) : i = n[0] : i = n.length > 2 ? n[2] : n[0];
|
|
1203
|
-
let o =
|
|
1205
|
+
let o = Dn(e, i.body, a);
|
|
1204
1206
|
return i.color ? {
|
|
1205
1207
|
text: o,
|
|
1206
1208
|
color: i.color
|
|
@@ -1208,10 +1210,10 @@ function On(e, t) {
|
|
|
1208
1210
|
}
|
|
1209
1211
|
//#endregion
|
|
1210
1212
|
//#region packages/xlsx/src/renderer-coordinate-index.ts
|
|
1211
|
-
var
|
|
1212
|
-
function
|
|
1213
|
-
let n =
|
|
1214
|
-
return new
|
|
1213
|
+
var An = u;
|
|
1214
|
+
function jn(e, t) {
|
|
1215
|
+
let n = An;
|
|
1216
|
+
return new le(`XLSX renderer ${e.resource} exceeded its hard limit of ${n} entries`, {
|
|
1215
1217
|
stage: "rendering",
|
|
1216
1218
|
violation: {
|
|
1217
1219
|
format: "xlsx",
|
|
@@ -1230,7 +1232,7 @@ function An(e, t) {
|
|
|
1230
1232
|
}
|
|
1231
1233
|
});
|
|
1232
1234
|
}
|
|
1233
|
-
function
|
|
1235
|
+
function Mn(e, t, n = 0) {
|
|
1234
1236
|
let { top: r, bottom: i, left: a, right: o } = e;
|
|
1235
1237
|
if (i < r || o < a) return 0;
|
|
1236
1238
|
if (![
|
|
@@ -1238,44 +1240,44 @@ function jn(e, t, n = 0) {
|
|
|
1238
1240
|
i,
|
|
1239
1241
|
a,
|
|
1240
1242
|
o
|
|
1241
|
-
].every(Number.isSafeInteger) || !Number.isSafeInteger(n) || n < 0) throw
|
|
1242
|
-
let s = i - r + 1, c = o - a + 1, l =
|
|
1243
|
-
if (!Number.isSafeInteger(s) || !Number.isSafeInteger(c) || s > l || c > Math.floor(l / s)) throw
|
|
1243
|
+
].every(Number.isSafeInteger) || !Number.isSafeInteger(n) || n < 0) throw jn(t, An + 1);
|
|
1244
|
+
let s = i - r + 1, c = o - a + 1, l = An + n;
|
|
1245
|
+
if (!Number.isSafeInteger(s) || !Number.isSafeInteger(c) || s > l || c > Math.floor(l / s)) throw jn(t, An + 1);
|
|
1244
1246
|
let u = s * c - n;
|
|
1245
|
-
if (u >
|
|
1247
|
+
if (u > An) throw jn(t, u);
|
|
1246
1248
|
return u;
|
|
1247
1249
|
}
|
|
1248
|
-
function
|
|
1249
|
-
if (!e.has(t) && e.size >=
|
|
1250
|
+
function Nn(e, t, n, r) {
|
|
1251
|
+
if (!e.has(t) && e.size >= An) throw jn(r, e.size + 1);
|
|
1250
1252
|
e.set(t, n);
|
|
1251
1253
|
}
|
|
1252
|
-
function
|
|
1254
|
+
function Pn(e, t) {
|
|
1253
1255
|
let n = /* @__PURE__ */ new Map();
|
|
1254
|
-
for (let r of e) for (let e of r.cells)
|
|
1256
|
+
for (let r of e) for (let e of r.cells) Nn(n, `${e.row}:${e.col}`, e, t);
|
|
1255
1257
|
return n;
|
|
1256
1258
|
}
|
|
1257
|
-
function
|
|
1258
|
-
if (!e.has(t) && e.size >=
|
|
1259
|
+
function Fn(e, t, n) {
|
|
1260
|
+
if (!e.has(t) && e.size >= An) throw jn(n, e.size + 1);
|
|
1259
1261
|
e.add(t);
|
|
1260
1262
|
}
|
|
1261
1263
|
//#endregion
|
|
1262
1264
|
//#region packages/xlsx/src/conditional-format.ts
|
|
1263
|
-
function
|
|
1265
|
+
function In(e, t, n) {
|
|
1264
1266
|
for (let r of e) if (t >= r.top && t <= r.bottom && n >= r.left && n <= r.right) return !0;
|
|
1265
1267
|
return !1;
|
|
1266
1268
|
}
|
|
1267
|
-
function
|
|
1269
|
+
function Ln(e) {
|
|
1268
1270
|
return e && e.value.type === "number" ? e.value.number : null;
|
|
1269
1271
|
}
|
|
1270
|
-
function
|
|
1272
|
+
function Rn(e) {
|
|
1271
1273
|
return e && e.value.type === "text" ? e.value.text : null;
|
|
1272
1274
|
}
|
|
1273
|
-
function
|
|
1275
|
+
function zn(e, t) {
|
|
1274
1276
|
let n = [];
|
|
1275
|
-
for (let r of e.rows) for (let e of r.cells) e.value.type === "number" &&
|
|
1277
|
+
for (let r of e.rows) for (let e of r.cells) e.value.type === "number" && In(t, e.row, e.col) && n.push(e.value.number);
|
|
1276
1278
|
return n;
|
|
1277
1279
|
}
|
|
1278
|
-
function
|
|
1280
|
+
function Bn(e, t) {
|
|
1279
1281
|
let n = t.length ? Math.min(...t) : 0, r = t.length ? Math.max(...t) : 0, i = e.value == null ? NaN : parseFloat(e.value);
|
|
1280
1282
|
switch (e.kind) {
|
|
1281
1283
|
case "min": return n;
|
|
@@ -1293,18 +1295,18 @@ function zn(e, t) {
|
|
|
1293
1295
|
default: return isNaN(i) ? 0 : i;
|
|
1294
1296
|
}
|
|
1295
1297
|
}
|
|
1296
|
-
function
|
|
1298
|
+
function Vn(e, t = Hn(e)) {
|
|
1297
1299
|
let n = [], r = /* @__PURE__ */ new Map();
|
|
1298
1300
|
for (let t of e.definedNames ?? []) r.set(t.name, t);
|
|
1299
1301
|
for (let t of e.conditionalFormats ?? []) {
|
|
1300
|
-
let r =
|
|
1302
|
+
let r = zn(e, t.sqref);
|
|
1301
1303
|
for (let e of t.rules) {
|
|
1302
1304
|
let i = {
|
|
1303
1305
|
rule: e,
|
|
1304
1306
|
sqref: t.sqref
|
|
1305
1307
|
};
|
|
1306
|
-
if (e.type === "colorScale") i.scaleStops = e.stops.map((e) =>
|
|
1307
|
-
else if (e.type === "dataBar") i.barMin =
|
|
1308
|
+
if (e.type === "colorScale") i.scaleStops = e.stops.map((e) => Bn(e, r));
|
|
1309
|
+
else if (e.type === "dataBar") i.barMin = Bn(e.min, r), i.barMax = Bn(e.max, r);
|
|
1308
1310
|
else if (e.type === "top10") {
|
|
1309
1311
|
let t = [...r].sort((e, t) => e - t), n = t.length;
|
|
1310
1312
|
if (n > 0) {
|
|
@@ -1323,7 +1325,7 @@ function Bn(e, t = Vn(e)) {
|
|
|
1323
1325
|
i.avgStdDev = Math.sqrt(e);
|
|
1324
1326
|
}
|
|
1325
1327
|
}
|
|
1326
|
-
} else e.type === "iconSet" && (i.iconThresholds = e.cfvos.map((e) =>
|
|
1328
|
+
} else e.type === "iconSet" && (i.iconThresholds = e.cfvos.map((e) => Bn(e, r)));
|
|
1327
1329
|
n.push(i);
|
|
1328
1330
|
}
|
|
1329
1331
|
}
|
|
@@ -1334,13 +1336,13 @@ function Bn(e, t = Vn(e)) {
|
|
|
1334
1336
|
definedNames: r
|
|
1335
1337
|
};
|
|
1336
1338
|
}
|
|
1337
|
-
function
|
|
1338
|
-
return
|
|
1339
|
+
function Hn(e) {
|
|
1340
|
+
return Pn(e.rows, {
|
|
1339
1341
|
resource: "worksheet-cell-index",
|
|
1340
1342
|
operation: "index-worksheet-cells"
|
|
1341
1343
|
});
|
|
1342
1344
|
}
|
|
1343
|
-
function
|
|
1345
|
+
function Un(e, t, n) {
|
|
1344
1346
|
switch (t) {
|
|
1345
1347
|
case "greaterThan": return e > (n[0] ?? 0);
|
|
1346
1348
|
case "greaterThanOrEqual": return e >= (n[0] ?? 0);
|
|
@@ -1353,13 +1355,13 @@ function Hn(e, t, n) {
|
|
|
1353
1355
|
default: return !1;
|
|
1354
1356
|
}
|
|
1355
1357
|
}
|
|
1356
|
-
function
|
|
1358
|
+
function Wn(e) {
|
|
1357
1359
|
let t = e.trim();
|
|
1358
1360
|
if (t.length >= 2 && t.startsWith("\"") && t.endsWith("\"")) return { text: t.slice(1, -1).replace(/""/g, "\"") };
|
|
1359
1361
|
let n = parseFloat(t);
|
|
1360
1362
|
return isNaN(n) ? { text: t } : { num: n };
|
|
1361
1363
|
}
|
|
1362
|
-
function
|
|
1364
|
+
function Gn(e, t, n) {
|
|
1363
1365
|
let r = n[0] ?? "", i = n[1] ?? "", a = (e) => e.toLowerCase();
|
|
1364
1366
|
switch (t) {
|
|
1365
1367
|
case "equal": return a(e) === a(r);
|
|
@@ -1373,21 +1375,21 @@ function Wn(e, t, n) {
|
|
|
1373
1375
|
default: return !1;
|
|
1374
1376
|
}
|
|
1375
1377
|
}
|
|
1376
|
-
function
|
|
1378
|
+
function Kn(e, t, n) {
|
|
1377
1379
|
let r = e.replace("#", ""), i = t.replace("#", ""), a = parseInt(r.slice(0, 2), 16), o = parseInt(r.slice(2, 4), 16), s = parseInt(r.slice(4, 6), 16), c = parseInt(i.slice(0, 2), 16), l = parseInt(i.slice(2, 4), 16), u = parseInt(i.slice(4, 6), 16), d = Math.round(a + (c - a) * n), f = Math.round(o + (l - o) * n), p = Math.round(s + (u - s) * n);
|
|
1378
1380
|
return `#${d.toString(16).padStart(2, "0").toUpperCase()}${f.toString(16).padStart(2, "0").toUpperCase()}${p.toString(16).padStart(2, "0").toUpperCase()}`;
|
|
1379
1381
|
}
|
|
1380
|
-
function
|
|
1382
|
+
function qn(e, t, n) {
|
|
1381
1383
|
if (!t.length) return "#FFFFFF";
|
|
1382
1384
|
if (e <= n[0]) return t[0].color;
|
|
1383
1385
|
if (e >= n[n.length - 1]) return t[t.length - 1].color;
|
|
1384
1386
|
for (let r = 1; r < n.length; r++) if (e <= n[r]) {
|
|
1385
1387
|
let i = n[r - 1], a = n[r], o = a === i ? 0 : (e - i) / (a - i);
|
|
1386
|
-
return
|
|
1388
|
+
return Kn(t[r - 1].color, t[r].color, o);
|
|
1387
1389
|
}
|
|
1388
1390
|
return t[t.length - 1].color;
|
|
1389
1391
|
}
|
|
1390
|
-
function
|
|
1392
|
+
function Jn(e, t) {
|
|
1391
1393
|
if (t && (t.fill && !e.fill && (e.fill = t.fill), t.font?.color && e.fontColor == null && (e.fontColor = t.font.color), t.font?.bold && e.fontBold == null && (e.fontBold = !0), t.font?.italic && e.fontItalic == null && (e.fontItalic = !0), t.font?.underline && e.fontUnderline == null && (e.fontUnderline = !0), t.font?.strike && e.fontStrike == null && (e.fontStrike = !0), t.numFmt && e.numFmt == null && (e.numFmt = {
|
|
1392
1394
|
numFmtId: t.numFmt.numFmtId,
|
|
1393
1395
|
formatCode: t.numFmt.formatCode || null
|
|
@@ -1403,16 +1405,16 @@ function qn(e, t) {
|
|
|
1403
1405
|
};
|
|
1404
1406
|
}
|
|
1405
1407
|
}
|
|
1406
|
-
function
|
|
1408
|
+
function Yn(e, t, n, r, i) {
|
|
1407
1409
|
let a = {};
|
|
1408
1410
|
if (!r.compiled.length) return a;
|
|
1409
1411
|
for (let o of r.compiled) {
|
|
1410
|
-
if (!
|
|
1411
|
-
let s = o.rule, c =
|
|
1412
|
+
if (!In(o.sqref, t, n)) continue;
|
|
1413
|
+
let s = o.rule, c = Ln(e);
|
|
1412
1414
|
if (s.type === "expression") {
|
|
1413
1415
|
let e = o.sqref[0];
|
|
1414
1416
|
if (!e) continue;
|
|
1415
|
-
if (
|
|
1417
|
+
if (gt(s.formula, {
|
|
1416
1418
|
row: t,
|
|
1417
1419
|
col: n,
|
|
1418
1420
|
anchorRow: e.top,
|
|
@@ -1420,19 +1422,19 @@ function Jn(e, t, n, r, i) {
|
|
|
1420
1422
|
cellIndex: r.cellIndex,
|
|
1421
1423
|
definedNames: r.definedNames,
|
|
1422
1424
|
depth: 0
|
|
1423
|
-
}) && (
|
|
1425
|
+
}) && (Jn(a, s.dxfId == null ? null : i[s.dxfId]), s.stopIfTrue)) break;
|
|
1424
1426
|
continue;
|
|
1425
1427
|
}
|
|
1426
1428
|
if (s.type === "cellIs") {
|
|
1427
|
-
let t = s.formulas.map(
|
|
1428
|
-
c != null && t.every((e) => e.num != null) ? r =
|
|
1429
|
+
let t = s.formulas.map(Wn), n = Rn(e), r = !1;
|
|
1430
|
+
c != null && t.every((e) => e.num != null) ? r = Un(c, s.operator, t.map((e) => e.num)) : n != null && t.every((e) => e.text != null) && (r = Gn(n, s.operator, t.map((e) => e.text))), r && Jn(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1429
1431
|
} else if (s.type === "top10") {
|
|
1430
1432
|
if (c == null || o.top10Threshold == null) continue;
|
|
1431
|
-
(o.top10IsTop ? c >= o.top10Threshold : c <= o.top10Threshold) &&
|
|
1433
|
+
(o.top10IsTop ? c >= o.top10Threshold : c <= o.top10Threshold) && Jn(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1432
1434
|
} else if (s.type === "aboveAverage") {
|
|
1433
1435
|
if (c == null || o.avgValue == null) continue;
|
|
1434
1436
|
let e = o.avgStdDev == null ? 0 : o.avgStdDev * (s.stdDev ?? 1), t = o.avgIsAbove ? o.avgValue + e : o.avgValue - e, n = s.equalAverage === !0;
|
|
1435
|
-
(o.avgIsAbove ? n ? c >= t : c > t : n ? c <= t : c < t) &&
|
|
1437
|
+
(o.avgIsAbove ? n ? c >= t : c > t : n ? c <= t : c < t) && Jn(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1436
1438
|
} else if (s.type === "iconSet") {
|
|
1437
1439
|
if (c == null || !o.iconThresholds?.length) continue;
|
|
1438
1440
|
let e = o.iconThresholds, t = e.length, n = 0;
|
|
@@ -1449,7 +1451,7 @@ function Jn(e, t, n, r, i) {
|
|
|
1449
1451
|
};
|
|
1450
1452
|
} else if (s.type === "colorScale") {
|
|
1451
1453
|
if (c == null || !o.scaleStops || a.fill) continue;
|
|
1452
|
-
let e =
|
|
1454
|
+
let e = qn(c, s.stops, o.scaleStops);
|
|
1453
1455
|
a.fill = {
|
|
1454
1456
|
patternType: "solid",
|
|
1455
1457
|
fgColor: e,
|
|
@@ -1469,21 +1471,21 @@ function Jn(e, t, n, r, i) {
|
|
|
1469
1471
|
}
|
|
1470
1472
|
//#endregion
|
|
1471
1473
|
//#region packages/xlsx/src/bidi-line.ts
|
|
1472
|
-
function
|
|
1473
|
-
return e === 2 ? !0 : e === 1 ? !1 :
|
|
1474
|
+
function Xn(e, t) {
|
|
1475
|
+
return e === 2 ? !0 : e === 1 ? !1 : ot(void 0, t) === "rtl";
|
|
1474
1476
|
}
|
|
1475
|
-
var
|
|
1477
|
+
var Zn = (e) => {
|
|
1476
1478
|
let t = e.text;
|
|
1477
1479
|
return typeof t == "string" ? t : void 0;
|
|
1478
1480
|
};
|
|
1479
|
-
function
|
|
1480
|
-
let n = e === 2 ||
|
|
1481
|
+
function Qn(e, t) {
|
|
1482
|
+
let n = e === 2 || R(t);
|
|
1481
1483
|
return {
|
|
1482
1484
|
needBidi: n,
|
|
1483
|
-
baseRtl: n &&
|
|
1485
|
+
baseRtl: n && Xn(e, t)
|
|
1484
1486
|
};
|
|
1485
1487
|
}
|
|
1486
|
-
function
|
|
1488
|
+
function $n(e, t) {
|
|
1487
1489
|
let r = e.length;
|
|
1488
1490
|
if (r === 0) return {
|
|
1489
1491
|
order: [],
|
|
@@ -1492,7 +1494,7 @@ function Qn(e, t) {
|
|
|
1492
1494
|
let i = "", a = Array(r);
|
|
1493
1495
|
for (let t = 0; t < r; t++) {
|
|
1494
1496
|
a[t] = i.length;
|
|
1495
|
-
let n =
|
|
1497
|
+
let n = Zn(e[t]) ?? "";
|
|
1496
1498
|
i += n.length > 0 ? n : "";
|
|
1497
1499
|
}
|
|
1498
1500
|
let { levels: o, paragraphLevel: s } = p().computeLevels(i, t ? "rtl" : "ltr"), { order: c, segLevels: l } = n(o, s, a), u = Array(r);
|
|
@@ -1502,21 +1504,21 @@ function Qn(e, t) {
|
|
|
1502
1504
|
rtl: u
|
|
1503
1505
|
};
|
|
1504
1506
|
}
|
|
1505
|
-
function
|
|
1507
|
+
function er(e, t = 8) {
|
|
1506
1508
|
return Math.trunc((256 * e + Math.trunc(128 / t)) / 256 * t);
|
|
1507
1509
|
}
|
|
1508
|
-
function
|
|
1510
|
+
function tr(e, t = 8) {
|
|
1509
1511
|
return e / t;
|
|
1510
1512
|
}
|
|
1511
|
-
function tr(e) {
|
|
1512
|
-
return Math.round(e * G);
|
|
1513
|
-
}
|
|
1514
1513
|
function nr(e) {
|
|
1515
|
-
return e
|
|
1514
|
+
return Math.round(e * Re);
|
|
1515
|
+
}
|
|
1516
|
+
function rr(e) {
|
|
1517
|
+
return e / Re;
|
|
1516
1518
|
}
|
|
1517
1519
|
//#endregion
|
|
1518
1520
|
//#region packages/xlsx/src/internal/grid-axis-geometry.ts
|
|
1519
|
-
var
|
|
1521
|
+
var ir = class e {
|
|
1520
1522
|
indices;
|
|
1521
1523
|
cumulativeDelta;
|
|
1522
1524
|
customPx;
|
|
@@ -1590,7 +1592,7 @@ var rr = class e {
|
|
|
1590
1592
|
}
|
|
1591
1593
|
return a;
|
|
1592
1594
|
}
|
|
1593
|
-
},
|
|
1595
|
+
}, ar = 1048576, Q = 16384, or = class e {
|
|
1594
1596
|
static cache = /* @__PURE__ */ new WeakMap();
|
|
1595
1597
|
static forWorksheet(t, n) {
|
|
1596
1598
|
let r = this.cache.get(t);
|
|
@@ -1615,7 +1617,42 @@ var rr = class e {
|
|
|
1615
1617
|
freezeCols;
|
|
1616
1618
|
scaledCache = null;
|
|
1617
1619
|
constructor(e, t) {
|
|
1618
|
-
this.maximumDigitWidth = t, this.freezeRows = Math.min(
|
|
1620
|
+
this.maximumDigitWidth = t, this.freezeRows = Math.min(ar, Math.max(0, e.freezeRows ?? 0)), this.freezeCols = Math.min(Q, Math.max(0, e.freezeCols ?? 0));
|
|
1621
|
+
let n = er(e.defaultColWidth, t), r = new Float64Array(Q + 1);
|
|
1622
|
+
r.fill(NaN);
|
|
1623
|
+
let i = new Int32Array(Q + 2);
|
|
1624
|
+
for (let e = 1; e < i.length; e++) i[e] = e;
|
|
1625
|
+
let a = (e) => {
|
|
1626
|
+
let t = e;
|
|
1627
|
+
for (; i[t] !== t;) t = i[t];
|
|
1628
|
+
let n = e;
|
|
1629
|
+
for (; i[n] !== n;) {
|
|
1630
|
+
let e = i[n];
|
|
1631
|
+
i[n] = t, n = e;
|
|
1632
|
+
}
|
|
1633
|
+
return t;
|
|
1634
|
+
}, o = e.colWidthRanges ?? [];
|
|
1635
|
+
for (let e = o.length - 1; e >= 0; e--) {
|
|
1636
|
+
let t = o[e], n = Math.max(1, Math.min(Q, Math.trunc(t.min))), s = Math.max(1, Math.min(Q, Math.trunc(t.max)));
|
|
1637
|
+
if (s < n || !Number.isFinite(t.width) || t.width < 0) continue;
|
|
1638
|
+
let c = a(n);
|
|
1639
|
+
for (; c <= s;) r[c] = t.width, i[c] = a(c + 1), c = i[c];
|
|
1640
|
+
}
|
|
1641
|
+
for (let [t, n] of Object.entries(e.colWidths)) {
|
|
1642
|
+
let e = Number(t);
|
|
1643
|
+
Number.isInteger(e) && e >= 1 && e <= 16384 && (r[e] = n);
|
|
1644
|
+
}
|
|
1645
|
+
let s = [];
|
|
1646
|
+
for (let e = 1; e <= Q; e++) {
|
|
1647
|
+
let i = r[e];
|
|
1648
|
+
if (!Number.isFinite(i) || i < 0) continue;
|
|
1649
|
+
let a = er(i, t);
|
|
1650
|
+
a !== n && s.push({
|
|
1651
|
+
index: e,
|
|
1652
|
+
px: a
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
this.col = new ir({}, n, (e) => er(e, t), Q, s), this.row = new ir(e.rowHeights, nr(e.defaultRowHeight), nr, ar);
|
|
1619
1656
|
}
|
|
1620
1657
|
logicalFrozenExtent() {
|
|
1621
1658
|
return {
|
|
@@ -1639,15 +1676,15 @@ var rr = class e {
|
|
|
1639
1676
|
}
|
|
1640
1677
|
logicalContentExtent(e, t, n, r) {
|
|
1641
1678
|
return {
|
|
1642
|
-
width: n + this.col.offsetOf(Math.min(
|
|
1643
|
-
height: r + this.row.offsetOf(Math.min(
|
|
1679
|
+
width: n + this.col.offsetOf(Math.min(Q, t) + 1),
|
|
1680
|
+
height: r + this.row.offsetOf(Math.min(ar, e) + 1)
|
|
1644
1681
|
};
|
|
1645
1682
|
}
|
|
1646
1683
|
roundedContentExtent(e, t, n, r, i) {
|
|
1647
1684
|
let a = this.axesAtScale(n);
|
|
1648
1685
|
return {
|
|
1649
|
-
width: Math.round(r * n) + a.col.offsetOf(Math.min(
|
|
1650
|
-
height: Math.round(i * n) + a.row.offsetOf(Math.min(
|
|
1686
|
+
width: Math.round(r * n) + a.col.offsetOf(Math.min(Q, t) + 1),
|
|
1687
|
+
height: Math.round(i * n) + a.row.offsetOf(Math.min(ar, e) + 1)
|
|
1651
1688
|
};
|
|
1652
1689
|
}
|
|
1653
1690
|
cellAt(e, t, n) {
|
|
@@ -1759,24 +1796,24 @@ function cr(e, t) {
|
|
|
1759
1796
|
//#region packages/xlsx/src/vertical-text.ts
|
|
1760
1797
|
function lr(e, t, n, r, i, a = !1) {
|
|
1761
1798
|
let o = t.codePointAt(0) ?? 0, s = ee(o);
|
|
1762
|
-
if (a &&
|
|
1763
|
-
e.save(), e.translate(n, r + i / 2), e.textAlign = "center", e.textBaseline = "middle",
|
|
1799
|
+
if (a && ie(o)) {
|
|
1800
|
+
e.save(), e.translate(n, r + i / 2), e.textAlign = "center", e.textBaseline = "middle", A(e, () => e.fillText(t, 0, 0)), e.restore();
|
|
1764
1801
|
return;
|
|
1765
1802
|
}
|
|
1766
1803
|
if (s === "Tr") {
|
|
1767
|
-
let a =
|
|
1804
|
+
let a = de(o);
|
|
1768
1805
|
if (a !== null) {
|
|
1769
1806
|
e.fillText(String.fromCodePoint(a), n, r);
|
|
1770
1807
|
return;
|
|
1771
1808
|
}
|
|
1772
|
-
if (
|
|
1809
|
+
if (ne(o)) {
|
|
1773
1810
|
e.fillText(t, n, r);
|
|
1774
1811
|
return;
|
|
1775
1812
|
}
|
|
1776
1813
|
e.save(), e.translate(n, r + i / 2), e.rotate(Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", e.fillText(t, 0, 0), e.restore();
|
|
1777
1814
|
return;
|
|
1778
1815
|
}
|
|
1779
|
-
let c = s === "Tu" ?
|
|
1816
|
+
let c = s === "Tu" ? j(o) : null;
|
|
1780
1817
|
e.fillText(c === null ? t : String.fromCodePoint(c), n, r);
|
|
1781
1818
|
}
|
|
1782
1819
|
//#endregion
|
|
@@ -1789,12 +1826,12 @@ function ur(e) {
|
|
|
1789
1826
|
function dr(e, t) {
|
|
1790
1827
|
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
1791
1828
|
}
|
|
1792
|
-
var fr =
|
|
1829
|
+
var fr = g.map((e) => `"${e}"`).join(", "), pr = t.map((e) => `"${e}"`).join(", "), mr = `"Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${fr}, sans-serif`, hr = `"Cambria", "Caladea", "Times New Roman", "Liberation Serif", "Noto Naskh Arabic", "Noto Sans Arabic", ${pr}, serif`, gr = "\"Courier New\", \"Liberation Mono\", monospace";
|
|
1793
1830
|
function _r(e) {
|
|
1794
|
-
let t = e ?
|
|
1831
|
+
let t = e ? H(e) : null, n = se(e);
|
|
1795
1832
|
if (!t) return n === "serif" ? hr : n === "mono" ? gr : mr;
|
|
1796
1833
|
let r = n === "serif";
|
|
1797
|
-
return `${
|
|
1834
|
+
return `${ue(t, r ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${r ? pr : fr}, ${r ? "serif" : "sans-serif"}`;
|
|
1798
1835
|
}
|
|
1799
1836
|
function vr(e) {
|
|
1800
1837
|
return e ? `"${e}", ${_r(e)}` : mr;
|
|
@@ -1808,7 +1845,7 @@ function xr(e, t, n, r) {
|
|
|
1808
1845
|
}
|
|
1809
1846
|
var Sr = "#7a7a7a";
|
|
1810
1847
|
function Cr(e, t) {
|
|
1811
|
-
let n = t *
|
|
1848
|
+
let n = t * Re, r = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : typeof document < "u" ? document.createElement("canvas") : null;
|
|
1812
1849
|
if (!r) return 8;
|
|
1813
1850
|
let i = r.getContext("2d");
|
|
1814
1851
|
if (!i) return 8;
|
|
@@ -1830,8 +1867,8 @@ function Tr(e, t, n, r, i, a, o) {
|
|
|
1830
1867
|
if (!(i <= 0 || a <= 0)) {
|
|
1831
1868
|
if (o) {
|
|
1832
1869
|
let a = e.createLinearGradient(n, r, n + i, r);
|
|
1833
|
-
a.addColorStop(0,
|
|
1834
|
-
} else e.fillStyle =
|
|
1870
|
+
a.addColorStop(0, w(t, .85)), a.addColorStop(1, w(t, .15)), e.fillStyle = a;
|
|
1871
|
+
} else e.fillStyle = w(t);
|
|
1835
1872
|
e.fillRect(n, r, i, a);
|
|
1836
1873
|
}
|
|
1837
1874
|
}
|
|
@@ -2025,11 +2062,11 @@ function kr(e, t, n, r) {
|
|
|
2025
2062
|
if (Dr.has(s)) return Dr.get(s);
|
|
2026
2063
|
let c = Or[t];
|
|
2027
2064
|
if (!c) return Dr.set(s, null), null;
|
|
2028
|
-
let l = c.length, u =
|
|
2065
|
+
let l = c.length, u = T(l, l);
|
|
2029
2066
|
if (!u) return Dr.set(s, null), null;
|
|
2030
2067
|
let d = u.getContext("2d");
|
|
2031
2068
|
if (!d) return Dr.set(s, null), null;
|
|
2032
|
-
d.fillStyle =
|
|
2069
|
+
d.fillStyle = w(r), d.fillRect(0, 0, l, l), d.fillStyle = w(n);
|
|
2033
2070
|
for (let e = 0; e < l; e++) {
|
|
2034
2071
|
let t = c[e];
|
|
2035
2072
|
for (let n = 0; n < l; n++) t & 1 << l - 1 - n && d.fillRect(n, e, 1, 1);
|
|
@@ -2046,12 +2083,12 @@ function Ar(e, t, n, r, i, a) {
|
|
|
2046
2083
|
let o = t.patternType;
|
|
2047
2084
|
if (!o || o === "none") return !1;
|
|
2048
2085
|
let s = t.fgColor ?? "000000", c = t.bgColor ?? "FFFFFF";
|
|
2049
|
-
if (o === "solid") return e.fillStyle =
|
|
2086
|
+
if (o === "solid") return e.fillStyle = w(s), e.fillRect(n, r, i, a), !0;
|
|
2050
2087
|
let l = kr(e, o, s, c);
|
|
2051
2088
|
if (l) e.fillStyle = l;
|
|
2052
2089
|
else {
|
|
2053
2090
|
let t = Er(o);
|
|
2054
|
-
e.fillStyle = t >= 1 ?
|
|
2091
|
+
e.fillStyle = t >= 1 ? w(s) : Pr(s, c, t);
|
|
2055
2092
|
}
|
|
2056
2093
|
return e.fillRect(n, r, i, a), !0;
|
|
2057
2094
|
}
|
|
@@ -2066,7 +2103,7 @@ function jr(e, t, n, r, i, a) {
|
|
|
2066
2103
|
}
|
|
2067
2104
|
for (let e of t.stops) {
|
|
2068
2105
|
let t = Math.min(1, Math.max(0, e.position));
|
|
2069
|
-
o.addColorStop(t,
|
|
2106
|
+
o.addColorStop(t, w(e.color));
|
|
2070
2107
|
}
|
|
2071
2108
|
return o;
|
|
2072
2109
|
}
|
|
@@ -2080,11 +2117,11 @@ function Pr(e, t, n) {
|
|
|
2080
2117
|
return `rgb(${Math.round(a * d + c * (1 - d))},${Math.round(o * d + l * (1 - d))},${Math.round(s * d + u * (1 - d))})`;
|
|
2081
2118
|
}
|
|
2082
2119
|
function Fr(e, t, n = 1, r) {
|
|
2083
|
-
let i = Math.round(e *
|
|
2084
|
-
return r ? Math.max(i, Math.round(
|
|
2120
|
+
let i = Math.round(e * Re * n * t);
|
|
2121
|
+
return r ? Math.max(i, Math.round(V(r, e * Re * t))) : i;
|
|
2085
2122
|
}
|
|
2086
2123
|
function Ir(e, t = 1) {
|
|
2087
|
-
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size *
|
|
2124
|
+
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * Re * t))}px ${vr(e.name)}`;
|
|
2088
2125
|
}
|
|
2089
2126
|
function Lr(e, t, n, r, i, a, o, s, c, l) {
|
|
2090
2127
|
if (t.length === 0) return;
|
|
@@ -2099,7 +2136,7 @@ function Lr(e, t, n, r, i, a, o, s, c, l) {
|
|
|
2099
2136
|
e.restore();
|
|
2100
2137
|
return;
|
|
2101
2138
|
}
|
|
2102
|
-
let m =
|
|
2139
|
+
let m = pt(t, r, o, f, (t) => Rr(e, t, i));
|
|
2103
2140
|
for (let t of m) {
|
|
2104
2141
|
let n = e.measureText(t.text).width, r = [...t.text];
|
|
2105
2142
|
if (t.spread === "distribute" && r.length > 1 && n < t.width) {
|
|
@@ -2123,10 +2160,10 @@ function Rr(e, t, n) {
|
|
|
2123
2160
|
}
|
|
2124
2161
|
function zr(e, t, n, r, i, a, o = 1) {
|
|
2125
2162
|
if (e.save(), e.strokeStyle = i, e.lineWidth = .5, e.beginPath(), a) {
|
|
2126
|
-
let i = r - 1, a = r + 1, s = i +
|
|
2163
|
+
let i = r - 1, a = r + 1, s = i + B(i, .5, o), c = a + B(a, .5, o);
|
|
2127
2164
|
e.moveTo(t, s), e.lineTo(n, s), e.moveTo(t, c), e.lineTo(n, c);
|
|
2128
2165
|
} else {
|
|
2129
|
-
let i = r +
|
|
2166
|
+
let i = r + B(r, .5, o);
|
|
2130
2167
|
e.moveTo(t, i), e.lineTo(n, i);
|
|
2131
2168
|
}
|
|
2132
2169
|
e.stroke(), e.restore();
|
|
@@ -2193,7 +2230,7 @@ function Wr(e, t) {
|
|
|
2193
2230
|
let n = t;
|
|
2194
2231
|
for (; n < e.length;) {
|
|
2195
2232
|
let t = e[e.length - n - 1], r = e[e.length - n], i = t?.codePointAt(0), a = r?.codePointAt(0);
|
|
2196
|
-
if (i !== void 0 && a !== void 0 &&
|
|
2233
|
+
if (i !== void 0 && a !== void 0 && y(i) && y(a)) n++;
|
|
2197
2234
|
else break;
|
|
2198
2235
|
}
|
|
2199
2236
|
return n >= e.length ? t : n;
|
|
@@ -2213,7 +2250,7 @@ function Kr(e, t, n) {
|
|
|
2213
2250
|
let r = [], i = [], a = 0;
|
|
2214
2251
|
for (; a < t.length;) {
|
|
2215
2252
|
let e = t[a], n = e.codePointAt(0) ?? 0;
|
|
2216
|
-
if (
|
|
2253
|
+
if (pe(n)) i.push(e), a += n > 65535 ? 2 : 1;
|
|
2217
2254
|
else if (e === " ") {
|
|
2218
2255
|
let e = a;
|
|
2219
2256
|
for (; e < t.length && t[e] === " ";) e++;
|
|
@@ -2222,10 +2259,10 @@ function Kr(e, t, n) {
|
|
|
2222
2259
|
let e = a;
|
|
2223
2260
|
for (; e < t.length;) {
|
|
2224
2261
|
let n = t[e], r = n.codePointAt(0) ?? 0;
|
|
2225
|
-
if (n === " " ||
|
|
2262
|
+
if (n === " " || pe(r)) break;
|
|
2226
2263
|
e += r > 65535 ? 2 : 1;
|
|
2227
2264
|
}
|
|
2228
|
-
let n = t.slice(a, e), r =
|
|
2265
|
+
let n = t.slice(a, e), r = P(n) ? v(n) : null;
|
|
2229
2266
|
if (r && r.length > 0) {
|
|
2230
2267
|
let e = 0;
|
|
2231
2268
|
for (let t of r) i.push(n.slice(e, t)), e = t;
|
|
@@ -2279,7 +2316,7 @@ function qr(e, t, n, r, i) {
|
|
|
2279
2316
|
let a = e.measureText(t).width;
|
|
2280
2317
|
if (o.length > 0 && s + a > i) {
|
|
2281
2318
|
let i = o.flatMap((e) => [...e.text]), a = Ur(i, [...t]);
|
|
2282
|
-
a > 0 ? a = Wr(i, a) : !
|
|
2319
|
+
a > 0 ? a = Wr(i, a) : !P(t) && !P(o[o.length - 1]?.text ?? "") && !/^\s/u.test(t) && !/\s$/u.test(i.at(-1) ?? "") && (a = Gr(i, [...t]));
|
|
2283
2320
|
let u = o[o.length - 1], d = [...u.text];
|
|
2284
2321
|
a > d.length && (a = d.length);
|
|
2285
2322
|
let f = null;
|
|
@@ -2305,21 +2342,21 @@ function qr(e, t, n, r, i) {
|
|
|
2305
2342
|
width: a
|
|
2306
2343
|
}), s += a, n.size > c && (c = n.size, l = n.name);
|
|
2307
2344
|
}, g = (t, n) => {
|
|
2308
|
-
let a =
|
|
2345
|
+
let a = v(t);
|
|
2309
2346
|
if (a.length === 0) {
|
|
2310
2347
|
h(t, n);
|
|
2311
2348
|
return;
|
|
2312
2349
|
}
|
|
2313
2350
|
e.font = Ir(Xr(n), r);
|
|
2314
|
-
let o = (t) => e.measureText(t).width, c =
|
|
2351
|
+
let o = (t) => e.measureText(t).width, c = me(t), l = t.length, u = 0;
|
|
2315
2352
|
for (; u < l;) {
|
|
2316
|
-
let e = i - s, r =
|
|
2353
|
+
let e = i - s, r = te(t, a, u, e, o, c);
|
|
2317
2354
|
if (r <= u) {
|
|
2318
2355
|
if (s > 0) {
|
|
2319
2356
|
p();
|
|
2320
2357
|
continue;
|
|
2321
2358
|
}
|
|
2322
|
-
let n = a.find((e) => e > u) ?? l, i = t.slice(u, n), d =
|
|
2359
|
+
let n = a.find((e) => e > u) ?? l, i = t.slice(u, n), d = E(i), f = te(i, d, 0, e, o, c);
|
|
2323
2360
|
f <= 0 && (f = d.length > 0 ? d[0] : i.length), r = u + f;
|
|
2324
2361
|
}
|
|
2325
2362
|
h(t.slice(u, r), n), u = r, u < l && p();
|
|
@@ -2330,7 +2367,7 @@ function qr(e, t, n, r, i) {
|
|
|
2330
2367
|
for (; i < e.text.length;) {
|
|
2331
2368
|
let t = e.text[i], n = t.codePointAt(0) ?? 0;
|
|
2332
2369
|
if (n === 10) r.push("\n"), i += 1;
|
|
2333
|
-
else if (
|
|
2370
|
+
else if (pe(n)) r.push(t), i += n > 65535 ? 2 : 1;
|
|
2334
2371
|
else if (t === " ") {
|
|
2335
2372
|
let t = i;
|
|
2336
2373
|
for (; t < e.text.length && e.text[t] === " ";) t++;
|
|
@@ -2339,13 +2376,13 @@ function qr(e, t, n, r, i) {
|
|
|
2339
2376
|
let t = i;
|
|
2340
2377
|
for (; t < e.text.length;) {
|
|
2341
2378
|
let n = e.text[t], r = n.codePointAt(0) ?? 0;
|
|
2342
|
-
if (n === " " || n === "\n" ||
|
|
2379
|
+
if (n === " " || n === "\n" || pe(r)) break;
|
|
2343
2380
|
t += r > 65535 ? 2 : 1;
|
|
2344
2381
|
}
|
|
2345
2382
|
r.push(e.text.slice(i, t)), i = t;
|
|
2346
2383
|
}
|
|
2347
2384
|
}
|
|
2348
|
-
for (let e of r) e === "\n" ? (m(), f++) :
|
|
2385
|
+
for (let e of r) e === "\n" ? (m(), f++) : P(e) ? g(e, t) : h(e, t);
|
|
2349
2386
|
}
|
|
2350
2387
|
return (o.length > 0 || a.length > 0) && m(), a;
|
|
2351
2388
|
}
|
|
@@ -2382,7 +2419,7 @@ function Xr(e) {
|
|
|
2382
2419
|
}
|
|
2383
2420
|
function Zr(e, t, n, r, i, a, o, s) {
|
|
2384
2421
|
e.textAlign = "left", e.textBaseline = i;
|
|
2385
|
-
let c = s.needBidi ?
|
|
2422
|
+
let c = s.needBidi ? $n(t, s.baseRtl ?? !1) : null, l = e, u = n;
|
|
2386
2423
|
for (let n = 0; n < t.length; n++) {
|
|
2387
2424
|
let d = c ? c.order[n] : n;
|
|
2388
2425
|
if (c) try {
|
|
@@ -2391,19 +2428,19 @@ function Zr(e, t, n, r, i, a, o, s) {
|
|
|
2391
2428
|
let f = t[d], p = Xr(f.font);
|
|
2392
2429
|
e.font = Ir(p, a);
|
|
2393
2430
|
let m = s.fontColor ?? f.font.color;
|
|
2394
|
-
e.fillStyle = m ?
|
|
2431
|
+
e.fillStyle = m ? w(m) : "#000000";
|
|
2395
2432
|
let h = Fr(f.font.size, a), g = 0;
|
|
2396
2433
|
f.font.vertAlign === "superscript" ? g = -Math.round(h * .35) : f.font.vertAlign === "subscript" && (g = Math.round(h * .1)), e.fillText(f.text, u, r + g);
|
|
2397
2434
|
let _ = Fr(p.size, a);
|
|
2398
2435
|
if (f.font.underline || f.font.strike) {
|
|
2399
2436
|
let t = Jr(i, r, _);
|
|
2400
2437
|
if (f.font.underline) {
|
|
2401
|
-
let n = m ?
|
|
2438
|
+
let n = m ? w(m) : "#000000", r = f.font.underlineStyle === "double" || f.font.underlineStyle === "doubleAccounting";
|
|
2402
2439
|
zr(e, u, u + f.width, t.underline + g, n, r, o);
|
|
2403
2440
|
}
|
|
2404
2441
|
if (f.font.strike) {
|
|
2405
|
-
let n = t.strike + g, r = n +
|
|
2406
|
-
e.save(), e.strokeStyle = m ?
|
|
2442
|
+
let n = t.strike + g, r = n + B(n, .5, o);
|
|
2443
|
+
e.save(), e.strokeStyle = m ? w(m) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(u, r), e.lineTo(u + f.width, r), e.stroke(), e.restore();
|
|
2407
2444
|
}
|
|
2408
2445
|
}
|
|
2409
2446
|
u += f.width;
|
|
@@ -2415,7 +2452,7 @@ function Zr(e, t, n, r, i, a, o, s) {
|
|
|
2415
2452
|
function Qr(e, t, n, r, i, a, o, s) {
|
|
2416
2453
|
let { alignH: c, cx: l, cellW: u, leftPad: d, paddingX: f } = n, p = t.reduce((e, t) => e + t.width, 0), m;
|
|
2417
2454
|
m = c === "right" ? l + u - f - p : c === "center" ? l + u / 2 - p / 2 : l + d;
|
|
2418
|
-
let { needBidi: h, baseRtl: g } =
|
|
2455
|
+
let { needBidi: h, baseRtl: g } = Qn(a.readingOrder, t.map((e) => e.text).join(""));
|
|
2419
2456
|
Zr(e, t, m, o, s, r, i, {
|
|
2420
2457
|
fontColor: a.fontColor,
|
|
2421
2458
|
needBidi: h,
|
|
@@ -2489,7 +2526,7 @@ function ii(e, t, n, r, i, a, o = {}) {
|
|
|
2489
2526
|
}
|
|
2490
2527
|
let _ = g.reduce((e, t) => e + Fr(t.maxFontSize, i, 1.2, t.maxFontFamily ?? void 0), 0), v;
|
|
2491
2528
|
v = c === "top" ? u + h : c === "center" ? u + (f - _) / 2 : u + f - _ - h;
|
|
2492
|
-
let y = t.map((e) => e.text).join("").split("\n").map((e) =>
|
|
2529
|
+
let y = t.map((e) => e.text).join("").split("\n").map((e) => Qn(o.readingOrder, e));
|
|
2493
2530
|
for (let t of g) {
|
|
2494
2531
|
let n = t.segments.reduce((e, t) => e + t.width, 0), r;
|
|
2495
2532
|
r = s === "right" ? l + d - m - n : s === "center" ? l + d / 2 - n / 2 : l + p;
|
|
@@ -2545,11 +2582,11 @@ function di(e) {
|
|
|
2545
2582
|
for (let r of e.tables ?? []) {
|
|
2546
2583
|
if (!r.styleName) continue;
|
|
2547
2584
|
let { top: e, bottom: i, left: a, right: o } = r.range;
|
|
2548
|
-
|
|
2585
|
+
Mn(r.range, n);
|
|
2549
2586
|
let s = r.accentColor || "#808080", c = !!r.isCustom, l = Math.max(0, r.headerRowCount ?? 1), u = Math.max(0, r.totalsRowCount ?? 0), d = e + l - 1, f = i - u + 1;
|
|
2550
2587
|
for (let p = e; p <= i; p++) {
|
|
2551
2588
|
let m = l > 0 && p <= d, h = u > 0 && p >= f, g = !m && !h ? p - d - 1 : -1, _ = r.showRowStripes && g >= 0 ? g % 2 == 1 ? r.band1HorizontalDxf : r.band2HorizontalDxf : void 0;
|
|
2552
|
-
for (let l = a; l <= o; l++)
|
|
2589
|
+
for (let l = a; l <= o; l++) Nn(t, `${p}:${l}`, {
|
|
2553
2590
|
accent: s,
|
|
2554
2591
|
isCustom: c,
|
|
2555
2592
|
isHeader: m,
|
|
@@ -2601,7 +2638,7 @@ function pi(e) {
|
|
|
2601
2638
|
}
|
|
2602
2639
|
for (let a of r.sparklines) {
|
|
2603
2640
|
let o = a.values.filter((e) => typeof e == "number"), s = o.length ? Math.min(...o) : 0, c = o.length ? Math.max(...o) : 1, l = r.minAxisType === "custom" && typeof r.manualMin == "number" ? r.manualMin : r.minAxisType === "group" ? e : s, u = r.maxAxisType === "custom" && typeof r.manualMax == "number" ? r.manualMax : r.maxAxisType === "group" ? i : c;
|
|
2604
|
-
|
|
2641
|
+
Nn(t, `${a.row}:${a.col}`, {
|
|
2605
2642
|
kind: r.kind,
|
|
2606
2643
|
values: a.values,
|
|
2607
2644
|
min: l,
|
|
@@ -2636,8 +2673,8 @@ function mi(e) {
|
|
|
2636
2673
|
}
|
|
2637
2674
|
function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
2638
2675
|
if (m <= 0 || h <= 0) return;
|
|
2639
|
-
let { styles: g, cellMap: _, mergeAnchorMap: v, mergeSkipSet: y, cfContext: b, cs: x, dpr: S } = t,
|
|
2640
|
-
for (let e = 0; e <
|
|
2676
|
+
let { styles: g, cellMap: _, mergeAnchorMap: v, mergeSkipSet: y, cfContext: b, cs: x, dpr: S } = t, C = i.length, T = a.length, E = new Set(s), D = new Set(o), O = (e, n) => t.rtl ? br(e, n, t.canvasW) : e, k = [], A = -c;
|
|
2677
|
+
for (let e = 0; e < C; e++) k.push(A), A += i[e];
|
|
2641
2678
|
let j = [], M = -l;
|
|
2642
2679
|
for (let e = 0; e < T; e++) j.push(M), M += a[e];
|
|
2643
2680
|
e.save(), e.beginPath(), e.rect(O(f, m), p, m, h), e.clip();
|
|
@@ -2649,14 +2686,14 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2649
2686
|
if (!p) continue;
|
|
2650
2687
|
let m = u - c + t.colAxis.offsetOf(f) - t.colAxis.offsetOf(r), h = d - l + t.rowAxis.offsetOf(a) - t.rowAxis.offsetOf(n), _ = p.totalW, v = p.totalH;
|
|
2651
2688
|
m = O(m, _);
|
|
2652
|
-
let y = `${a}:${f}`,
|
|
2689
|
+
let y = `${a}:${f}`, C = t.cellMap.get(y), { font: T, fill: k, border: A, xf: j } = Vr(g, C?.styleIndex ?? 0), M = Yn(C, a, f, b, g.dxfs ?? []);
|
|
2653
2690
|
if (Ar(e, M.fill ?? k, m, h, _, v), M.dataBar && M.dataBar.ratio > 0) {
|
|
2654
2691
|
let t = Math.max(0, (_ - 4) * M.dataBar.ratio);
|
|
2655
2692
|
Tr(e, M.dataBar.color, m + 2, h + 2, t, v - 4, M.dataBar.gradient);
|
|
2656
2693
|
}
|
|
2657
2694
|
let ee = Gi(Wi(A, a, f, p.right, p.bottom, t.cellMap, g), M.border);
|
|
2658
|
-
if (te.push(() => qi(e, ee, m, h, _, v, S)), !
|
|
2659
|
-
let N =
|
|
2695
|
+
if (te.push(() => qi(e, ee, m, h, _, v, S)), !C) continue;
|
|
2696
|
+
let N = Zt(C, g, M.numFmt, t.worksheet.date1904), P = N.text;
|
|
2660
2697
|
if (!P || P === "0" && t.worksheet.showZeros === !1) continue;
|
|
2661
2698
|
let F = T.bold || !!M.fontBold, I = T.italic || !!M.fontItalic, L = T.underline || !!M.fontUnderline, R = T.strike || !!M.fontStrike, z = F !== T.bold || I !== T.italic || L !== T.underline || R !== T.strike ? {
|
|
2662
2699
|
...T,
|
|
@@ -2667,15 +2704,15 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2667
2704
|
} : T;
|
|
2668
2705
|
e.font = Ir(z, x);
|
|
2669
2706
|
let ne = t.hyperlinkMap.get(y) ? "#0563C1" : M.fontColor ?? N.color ?? T.color;
|
|
2670
|
-
e.fillStyle = ne ?
|
|
2671
|
-
let B =
|
|
2707
|
+
e.fillStyle = ne ? w(ne) : "#000000";
|
|
2708
|
+
let B = C.value.type === "number", V = j.alignH ?? (B ? "right" : "left"), H = j.alignV ?? "bottom", re = j.indent ? Math.round(j.indent * 3 * t.mdw) : 0, ie = 3 + (V === "left" || !j.alignH ? re : 0);
|
|
2672
2709
|
e.save(), e.beginPath(), e.rect(m, h, _, v), e.clip();
|
|
2673
2710
|
let U;
|
|
2674
2711
|
V === "right" ? (U = m + _ - 3, e.textAlign = "right") : V === "center" ? (U = m + _ / 2, e.textAlign = "center") : (U = m + ie, e.textAlign = "left");
|
|
2675
|
-
let
|
|
2676
|
-
if (j.wrapText &&
|
|
2712
|
+
let ae = C.value.type === "text" ? C.value.runs : void 0, oe = ae && ae.length > 0;
|
|
2713
|
+
if (j.wrapText && oe) ii(e, ae, z, {
|
|
2677
2714
|
alignH: V,
|
|
2678
|
-
alignV:
|
|
2715
|
+
alignV: H,
|
|
2679
2716
|
cx: m,
|
|
2680
2717
|
cy: h,
|
|
2681
2718
|
cellW: _,
|
|
@@ -2689,7 +2726,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2689
2726
|
});
|
|
2690
2727
|
else if (j.wrapText) ri(e, P, U, z, {
|
|
2691
2728
|
alignH: V,
|
|
2692
|
-
alignV:
|
|
2729
|
+
alignV: H,
|
|
2693
2730
|
cx: m,
|
|
2694
2731
|
cy: h,
|
|
2695
2732
|
cellW: _,
|
|
@@ -2698,9 +2735,9 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2698
2735
|
paddingX: 3,
|
|
2699
2736
|
paddingY: 2
|
|
2700
2737
|
}, x);
|
|
2701
|
-
else if (
|
|
2738
|
+
else if (oe) ni(e, ae, z, {
|
|
2702
2739
|
alignH: V,
|
|
2703
|
-
alignV:
|
|
2740
|
+
alignV: H,
|
|
2704
2741
|
cx: m,
|
|
2705
2742
|
cy: h,
|
|
2706
2743
|
cellW: _,
|
|
@@ -2715,7 +2752,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2715
2752
|
else {
|
|
2716
2753
|
let { baseline: t, textY: n } = Yr({
|
|
2717
2754
|
alignH: V,
|
|
2718
|
-
alignV:
|
|
2755
|
+
alignV: H,
|
|
2719
2756
|
cx: m,
|
|
2720
2757
|
cy: h,
|
|
2721
2758
|
cellW: _,
|
|
@@ -2741,9 +2778,9 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2741
2778
|
}
|
|
2742
2779
|
D = -1;
|
|
2743
2780
|
};
|
|
2744
|
-
for (let e = 0; e <=
|
|
2781
|
+
for (let e = 0; e <= C; e++) {
|
|
2745
2782
|
let t = !1, n = !1;
|
|
2746
|
-
if (e <
|
|
2783
|
+
if (e < C) {
|
|
2747
2784
|
let i = `${r}:${o[e]}`;
|
|
2748
2785
|
if (!y.has(i) && !v.has(i)) {
|
|
2749
2786
|
let e = _.get(i);
|
|
@@ -2752,82 +2789,82 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2752
2789
|
}
|
|
2753
2790
|
t ? n && D >= 0 && e > D ? (A(e), D = e) : D < 0 && (D = e) : A(e);
|
|
2754
2791
|
}
|
|
2755
|
-
for (let a = 0; a <
|
|
2792
|
+
for (let a = 0; a < C; a++) {
|
|
2756
2793
|
let s = o[a], d = u + k[a], D = i[a], A = `${r}:${s}`;
|
|
2757
2794
|
if (y.has(A)) continue;
|
|
2758
2795
|
let j = v.get(A), M = j ? j.totalW : D, P = j ? j.totalH : l, F = d + M <= f || d >= f + m;
|
|
2759
2796
|
if (c + P <= p || c >= p + h || F && !t.overflowTextAnchors.has(A)) continue;
|
|
2760
|
-
let I = O(d, M), L = _.get(A), { font: R, fill: z, border: ne, xf:
|
|
2761
|
-
if (Ar(e, re, I, c, M, P) || (
|
|
2762
|
-
let t = Math.max(0, (M - 4) *
|
|
2763
|
-
Tr(e,
|
|
2797
|
+
let I = O(d, M), L = _.get(A), { font: R, fill: z, border: ne, xf: V } = Vr(g, L?.styleIndex ?? 0), H = Yn(L, r, s, b, g.dxfs ?? []), re = H.fill ?? z, U = t.tableStyleMap.get(A), ae = g.dxfs ?? [], oe = (e) => e == null ? void 0 : ae[e], se = oe(U?.wholeTableDxf), le = oe(U?.headerRowDxf), ue = oe(U?.totalRowDxf), de = oe(U?.firstColumnDxf), fe = oe(U?.lastColumnDxf), pe = oe(U?.stripeDxf), me = U?.isHeader && le?.fill?.fgColor ? le : U?.isTotals && ue?.fill?.fgColor ? ue : U?.isLastCol && fe?.fill?.fgColor ? fe : U?.isFirstCol && de?.fill?.fgColor ? de : pe?.fill?.fgColor ? pe : !U?.isHeader && !U?.isTotals && se?.fill?.fgColor ? se : void 0;
|
|
2798
|
+
if (Ar(e, re, I, c, M, P) || (U && me?.fill?.fgColor ? (e.fillStyle = w(me.fill.fgColor), e.fillRect(I, c, M, P)) : U && !U.isCustom && U.isBanded && (e.fillStyle = mi(U.accent), e.fillRect(I, c, M, P))), t.commentCells.has(A) && Nr(e, I, c, M, P), H.dataBar && H.dataBar.ratio > 0) {
|
|
2799
|
+
let t = Math.max(0, (M - 4) * H.dataBar.ratio);
|
|
2800
|
+
Tr(e, H.dataBar.color, I + 2, c + 2, t, P - 4, H.dataBar.gradient);
|
|
2764
2801
|
}
|
|
2765
|
-
let
|
|
2766
|
-
if (
|
|
2802
|
+
let he = t.sparklineMap.get(A);
|
|
2803
|
+
if (he && nt(e, {
|
|
2767
2804
|
x: I,
|
|
2768
2805
|
y: c,
|
|
2769
2806
|
w: M,
|
|
2770
2807
|
h: P
|
|
2771
|
-
},
|
|
2808
|
+
}, he), t.worksheet.isChartSheet !== !0 && t.worksheet.showGridlines !== !1) {
|
|
2772
2809
|
if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !T.has(a)) {
|
|
2773
|
-
let t = I + M +
|
|
2810
|
+
let t = I + M + B(I + M, .5, S);
|
|
2774
2811
|
e.moveTo(t, c), e.lineTo(t, c + P);
|
|
2775
2812
|
}
|
|
2776
|
-
let t = c + P +
|
|
2813
|
+
let t = c + P + B(c + P, .5, S);
|
|
2777
2814
|
if (e.moveTo(I, t), e.lineTo(I + M, t), n === 0) {
|
|
2778
|
-
let t = c +
|
|
2815
|
+
let t = c + B(c, .5, S);
|
|
2779
2816
|
e.moveTo(I, t), e.lineTo(I + M, t);
|
|
2780
2817
|
}
|
|
2781
2818
|
if (a === 0) {
|
|
2782
|
-
let t = I +
|
|
2819
|
+
let t = I + B(I, .5, S);
|
|
2783
2820
|
e.moveTo(t, c), e.lineTo(t, c + P);
|
|
2784
2821
|
}
|
|
2785
2822
|
e.stroke();
|
|
2786
2823
|
}
|
|
2787
|
-
let
|
|
2788
|
-
(T.has(a) || E.has(a)) && (
|
|
2789
|
-
...
|
|
2790
|
-
left: E.has(a) ? null :
|
|
2791
|
-
right: T.has(a) ? null :
|
|
2824
|
+
let W = Gi(j ? Wi(ne, r, s, j.right, j.bottom, _, g) : ne, H.border);
|
|
2825
|
+
(T.has(a) || E.has(a)) && (W = {
|
|
2826
|
+
...W,
|
|
2827
|
+
left: E.has(a) ? null : W.left,
|
|
2828
|
+
right: T.has(a) ? null : W.right
|
|
2792
2829
|
});
|
|
2793
|
-
let
|
|
2794
|
-
if (
|
|
2795
|
-
...
|
|
2796
|
-
top: Zi(
|
|
2830
|
+
let G = _.get(`${r - 1}:${s}`), K = G ? Vr(g, G.styleIndex ?? 0).border.bottom : null;
|
|
2831
|
+
if (K?.style && (n === 0 || W.top?.style) && (W = {
|
|
2832
|
+
...W,
|
|
2833
|
+
top: Zi(W.top, K)
|
|
2797
2834
|
}), !E.has(a)) {
|
|
2798
2835
|
let e = _.get(`${r}:${s - 1}`), t = e ? Vr(g, e.styleIndex ?? 0).border.right : null;
|
|
2799
|
-
t?.style && (a === 0 ||
|
|
2800
|
-
...
|
|
2801
|
-
left: Zi(
|
|
2836
|
+
t?.style && (a === 0 || W.left?.style) && (W = {
|
|
2837
|
+
...W,
|
|
2838
|
+
left: Zi(W.left, t)
|
|
2802
2839
|
});
|
|
2803
2840
|
}
|
|
2804
|
-
let
|
|
2805
|
-
if (
|
|
2806
|
-
if (
|
|
2807
|
-
else if (
|
|
2841
|
+
let ge = U ? fi(U, se, le, s) : null, _e = t.autoFilterCells.has(A), ve = () => {
|
|
2842
|
+
if (ge) {
|
|
2843
|
+
if (ge.kind === "dxf") qi(e, ge.border, I, c, M, P, S);
|
|
2844
|
+
else if (ge.kind === "accent") {
|
|
2808
2845
|
let t = .5 / S;
|
|
2809
|
-
if (e.strokeStyle =
|
|
2810
|
-
let t = c +
|
|
2846
|
+
if (e.strokeStyle = ge.color, e.lineWidth = ge.lineWidth, e.beginPath(), e.moveTo(I, c + P - t), e.lineTo(I + M, c + P - t), ge.topEdge) {
|
|
2847
|
+
let t = c + B(c, ge.lineWidth, S);
|
|
2811
2848
|
e.moveTo(I, t), e.lineTo(I + M, t);
|
|
2812
2849
|
}
|
|
2813
2850
|
e.stroke();
|
|
2814
2851
|
}
|
|
2815
2852
|
}
|
|
2816
|
-
|
|
2853
|
+
_e && ui(e, I, c, D, P);
|
|
2817
2854
|
};
|
|
2818
2855
|
if (j) {
|
|
2819
|
-
let t =
|
|
2820
|
-
te.push(() => qi(e, t, I, c, M, P, S)),
|
|
2856
|
+
let t = W;
|
|
2857
|
+
te.push(() => qi(e, t, I, c, M, P, S)), ve();
|
|
2821
2858
|
} else {
|
|
2822
|
-
let t =
|
|
2859
|
+
let t = W;
|
|
2823
2860
|
N.push(() => {
|
|
2824
|
-
qi(e, t, I, c, M, P, S),
|
|
2861
|
+
qi(e, t, I, c, M, P, S), ve();
|
|
2825
2862
|
});
|
|
2826
2863
|
}
|
|
2827
2864
|
if (!L) continue;
|
|
2828
|
-
let
|
|
2829
|
-
!
|
|
2830
|
-
let n =
|
|
2865
|
+
let ye = Zt(L, g, H.numFmt, t.worksheet.date1904), q = ye.text;
|
|
2866
|
+
!q || q === "0" && t.worksheet.showZeros === !1 || ee.push(() => {
|
|
2867
|
+
let n = U?.isHeader ? le : U?.isTotals ? ue : U?.isLastCol && fe ? fe : U?.isFirstCol && de ? de : pe || (U ? se : void 0), l = U ? U.isCustom ? !!n?.font?.bold : U.isHeader || U.isTotals : !1, u = R.bold || !!H.fontBold || l, d = R.italic || !!H.fontItalic, f = R.underline || !!H.fontUnderline, p = R.strike || !!H.fontStrike, m = u !== R.bold || d !== R.italic || f !== R.underline || p !== R.strike ? {
|
|
2831
2868
|
...R,
|
|
2832
2869
|
bold: u,
|
|
2833
2870
|
italic: d,
|
|
@@ -2835,90 +2872,90 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2835
2872
|
strike: p
|
|
2836
2873
|
} : R;
|
|
2837
2874
|
e.font = Ir(m, x);
|
|
2838
|
-
let h = t.hyperlinkMap.get(A), b = n?.font?.color ?? null, T = h ? "#0563C1" :
|
|
2839
|
-
e.fillStyle = T ?
|
|
2840
|
-
let E = L.value.type === "number", D =
|
|
2841
|
-
if (D === "centerContinuous" && !j) for (let e = a + 1; e <
|
|
2875
|
+
let h = t.hyperlinkMap.get(A), b = n?.font?.color ?? null, T = h ? "#0563C1" : H.fontColor ?? ye.color ?? b ?? R.color;
|
|
2876
|
+
e.fillStyle = T ? w(T) : "#000000";
|
|
2877
|
+
let E = L.value.type === "number", D = V.alignH ?? (E ? "right" : "left"), O = V.alignV ?? "bottom", k = V.indent ? Math.round(V.indent * 3 * t.mdw) : 0, ee = H.iconSet ? Math.max(8, Math.round(Math.min(M, P) * .55)) : 0, te = ee > 0 ? ee + 4 : 0, N = 3 + (D === "left" || !V.alignH ? k : 0) + te, F = M, z = a;
|
|
2878
|
+
if (D === "centerContinuous" && !j) for (let e = a + 1; e < C; e++) {
|
|
2842
2879
|
let t = `${r}:${o[e]}`;
|
|
2843
2880
|
if (y.has(t) || v.has(t)) break;
|
|
2844
2881
|
let n = _.get(t);
|
|
2845
2882
|
if (n && n.value.type !== "empty" || Vr(g, n?.styleIndex ?? 0).xf.alignH !== "centerContinuous") break;
|
|
2846
2883
|
F += i[e], z = e;
|
|
2847
2884
|
}
|
|
2848
|
-
let ne = t.rtl ? I - (F - M) : I, re = D === "centerContinuous" ? ne : I,
|
|
2849
|
-
if (!j && !
|
|
2850
|
-
let n = e.measureText(
|
|
2885
|
+
let ne = t.rtl ? I - (F - M) : I, re = D === "centerContinuous" ? ne : I, ae = D === "centerContinuous" ? F : M, oe = q.includes("\n");
|
|
2886
|
+
if (!j && !V.wrapText && !V.textRotation && !E && !oe) {
|
|
2887
|
+
let n = e.measureText(q).width, s = D === "centerContinuous", c = s ? n + 6 : n + N + 3, l = s ? F : M;
|
|
2851
2888
|
if (c > l) {
|
|
2852
2889
|
let e = c - l, n = 0, u = 0;
|
|
2853
2890
|
D === "right" ? u = e : D === "center" || s ? (u = e / 2, n = e / 2) : n = e;
|
|
2854
2891
|
let d = t.rtl ? -1 : 1, f = t.rtl ? a - 1 : z + 1, p = t.rtl ? 1 : -1, m = t.rtl ? z + 1 : a - 1;
|
|
2855
2892
|
if (n > 0) {
|
|
2856
2893
|
let e = n;
|
|
2857
|
-
for (let t = f; t >= 0 && t <
|
|
2894
|
+
for (let t = f; t >= 0 && t < C && e > 0; t += d) {
|
|
2858
2895
|
let n = `${r}:${o[t]}`;
|
|
2859
2896
|
if (y.has(n) || v.has(n)) break;
|
|
2860
2897
|
let a = _.get(n);
|
|
2861
2898
|
if (a && a.value.type !== "empty") break;
|
|
2862
|
-
|
|
2899
|
+
ae += i[t], e -= i[t];
|
|
2863
2900
|
}
|
|
2864
2901
|
}
|
|
2865
2902
|
if (u > 0) {
|
|
2866
2903
|
let e = u;
|
|
2867
|
-
for (let t = m; t >= 0 && t <
|
|
2904
|
+
for (let t = m; t >= 0 && t < C && e > 0; t += p) {
|
|
2868
2905
|
let n = `${r}:${o[t]}`;
|
|
2869
2906
|
if (y.has(n) || v.has(n)) break;
|
|
2870
2907
|
let a = _.get(n);
|
|
2871
2908
|
if (a && a.value.type !== "empty") break;
|
|
2872
|
-
re -= i[t],
|
|
2909
|
+
re -= i[t], ae += i[t], e -= i[t];
|
|
2873
2910
|
}
|
|
2874
2911
|
}
|
|
2875
2912
|
}
|
|
2876
2913
|
}
|
|
2877
|
-
let
|
|
2878
|
-
if (D === "fill" && !E &&
|
|
2879
|
-
let t = Math.max(1, M - 6), n = e.measureText(
|
|
2914
|
+
let me = q, he = 0;
|
|
2915
|
+
if (D === "fill" && !E && q.length > 0) {
|
|
2916
|
+
let t = Math.max(1, M - 6), n = e.measureText(q).width;
|
|
2880
2917
|
if (n > 0 && n < t) {
|
|
2881
2918
|
let e = Math.max(1, Math.floor(t / n));
|
|
2882
|
-
|
|
2919
|
+
me = q.repeat(e);
|
|
2883
2920
|
}
|
|
2884
2921
|
}
|
|
2885
|
-
if (D === "distributed" || D === "justify" && !
|
|
2886
|
-
let t = Math.max(1, M - 6), n = e.measureText(
|
|
2887
|
-
n < t && (
|
|
2922
|
+
if (D === "distributed" || D === "justify" && !V.wrapText && !oe) {
|
|
2923
|
+
let t = Math.max(1, M - 6), n = e.measureText(me).width, r = Math.max(1, [...me].length - 1);
|
|
2924
|
+
n < t && (he = Math.max(0, (t - n) / r));
|
|
2888
2925
|
}
|
|
2889
|
-
let
|
|
2890
|
-
D === "right" ? (
|
|
2891
|
-
let
|
|
2892
|
-
if (
|
|
2893
|
-
let t = Fr(R.size, x, 1.1), n = [...
|
|
2926
|
+
let W, G;
|
|
2927
|
+
D === "right" ? (W = I + M - 3, G = "right") : D === "center" ? (W = I + M / 2, G = "center") : D === "centerContinuous" ? (W = ne + F / 2, G = "center") : D === "distributed" || D === "justify" && !V.wrapText && !oe ? (W = I + 3, G = "left") : (W = I + N, G = "left");
|
|
2928
|
+
let K = V.textRotation ?? 0, ge = K === 255, _e = K > 0 && K !== 255;
|
|
2929
|
+
if (H.iconSet && ee > 0 && (e.save(), e.beginPath(), e.rect(I, c, M, P), e.clip(), li(e, H.iconSet.name, H.iconSet.index, I + 2, c + (P - ee) / 2, ee), e.restore()), e.save(), e.beginPath(), e.rect(re, c, ae, P), e.clip(), ge) {
|
|
2930
|
+
let t = Fr(R.size, x, 1.1), n = [...q].length * t, r = O === "top" ? c + 2 : O === "center" ? c + (P - n) / 2 : c + P - n - 2;
|
|
2894
2931
|
e.textAlign = "center", e.textBaseline = "top";
|
|
2895
|
-
for (let n of
|
|
2896
|
-
let i = n.codePointAt(0) ?? 0, a =
|
|
2932
|
+
for (let n of q) {
|
|
2933
|
+
let i = n.codePointAt(0) ?? 0, a = ie(i) && ce(e, i);
|
|
2897
2934
|
lr(e, n, I + M / 2, r, t, a), r += t;
|
|
2898
2935
|
}
|
|
2899
2936
|
e.restore();
|
|
2900
2937
|
return;
|
|
2901
2938
|
}
|
|
2902
|
-
if (
|
|
2903
|
-
let t =
|
|
2904
|
-
e.translate(I + M / 2, c + P / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(
|
|
2939
|
+
if (_e) {
|
|
2940
|
+
let t = K <= 90 ? -(K * Math.PI / 180) : (K - 90) * Math.PI / 180;
|
|
2941
|
+
e.translate(I + M / 2, c + P / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(q, 0, 0), e.restore();
|
|
2905
2942
|
return;
|
|
2906
2943
|
}
|
|
2907
|
-
if (
|
|
2908
|
-
let t = e.measureText(
|
|
2944
|
+
if (V.shrinkToFit) {
|
|
2945
|
+
let t = e.measureText(q).width, n = M - N - 3;
|
|
2909
2946
|
if (t > n && t > 0) {
|
|
2910
2947
|
let r = n / t, i = D === "right" ? I + M - 3 : D === "center" ? I + M / 2 : I + N;
|
|
2911
2948
|
e.transform(r, 0, 0, 1, i * (1 - r), 0);
|
|
2912
2949
|
}
|
|
2913
2950
|
}
|
|
2914
|
-
if (e.textAlign =
|
|
2915
|
-
e.letterSpacing = `${
|
|
2951
|
+
if (e.textAlign = G, he > 0) try {
|
|
2952
|
+
e.letterSpacing = `${he}px`;
|
|
2916
2953
|
} catch {}
|
|
2917
2954
|
try {
|
|
2918
|
-
e.direction =
|
|
2955
|
+
e.direction = Xn(V.readingOrder, q) ? "rtl" : "ltr";
|
|
2919
2956
|
} catch {}
|
|
2920
|
-
let
|
|
2921
|
-
if (
|
|
2957
|
+
let ve = L.value.type === "text" ? L.value.runs : void 0, be = ve && ve.length > 0;
|
|
2958
|
+
if (V.wrapText && be) ii(e, ve, m, {
|
|
2922
2959
|
alignH: D,
|
|
2923
2960
|
alignV: O,
|
|
2924
2961
|
cx: I,
|
|
@@ -2929,10 +2966,10 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2929
2966
|
paddingX: 3,
|
|
2930
2967
|
paddingY: 2
|
|
2931
2968
|
}, x, S, {
|
|
2932
|
-
fontColor:
|
|
2933
|
-
readingOrder:
|
|
2969
|
+
fontColor: H.fontColor,
|
|
2970
|
+
readingOrder: V.readingOrder
|
|
2934
2971
|
});
|
|
2935
|
-
else if (
|
|
2972
|
+
else if (V.wrapText) ri(e, q, W, m, {
|
|
2936
2973
|
alignH: D,
|
|
2937
2974
|
alignV: O,
|
|
2938
2975
|
cx: I,
|
|
@@ -2943,7 +2980,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2943
2980
|
paddingX: 3,
|
|
2944
2981
|
paddingY: 2
|
|
2945
2982
|
}, x);
|
|
2946
|
-
else if (
|
|
2983
|
+
else if (be) ni(e, ve, m, {
|
|
2947
2984
|
alignH: D,
|
|
2948
2985
|
alignV: O,
|
|
2949
2986
|
cx: I,
|
|
@@ -2954,8 +2991,8 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2954
2991
|
paddingX: 3,
|
|
2955
2992
|
paddingY: 2
|
|
2956
2993
|
}, x, S, {
|
|
2957
|
-
fontColor:
|
|
2958
|
-
readingOrder:
|
|
2994
|
+
fontColor: H.fontColor,
|
|
2995
|
+
readingOrder: V.readingOrder
|
|
2959
2996
|
});
|
|
2960
2997
|
else {
|
|
2961
2998
|
let t = m.vertAlign, n = Fr(R.size, x), r = 0;
|
|
@@ -2965,25 +3002,25 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2965
3002
|
size: m.size * .65
|
|
2966
3003
|
} : m;
|
|
2967
3004
|
t && (e.font = Ir(i, x));
|
|
2968
|
-
let a = null, o = () => a ??= e.measureText(
|
|
2969
|
-
let e = Math.min(o().width,
|
|
3005
|
+
let a = null, o = () => a ??= e.measureText(q), s = () => {
|
|
3006
|
+
let e = Math.min(o().width, ae - N - 3);
|
|
2970
3007
|
return {
|
|
2971
3008
|
x: D === "right" ? I + M - 3 - e : D === "center" ? I + M / 2 - e / 2 : I + N,
|
|
2972
3009
|
width: e
|
|
2973
3010
|
};
|
|
2974
3011
|
}, l = Fr(i.size, x);
|
|
2975
3012
|
if (m.underline || h) {
|
|
2976
|
-
let { x: t, width: n } = s(), i = (O === "top" ? c + 2 + l + 1 : O === "center" ? c + P / 2 + Math.round(l * .55) : c + P - 2 + 1) + r, a = h ? "#0563C1" : T ?
|
|
3013
|
+
let { x: t, width: n } = s(), i = (O === "top" ? c + 2 + l + 1 : O === "center" ? c + P / 2 + Math.round(l * .55) : c + P - 2 + 1) + r, a = h ? "#0563C1" : T ? w(T) : "#000000", o = m.underlineStyle === "double" || m.underlineStyle === "doubleAccounting";
|
|
2977
3014
|
zr(e, t, t + n, i, a, o, S);
|
|
2978
3015
|
}
|
|
2979
3016
|
if (m.strike) {
|
|
2980
|
-
let { x: t, width: n } = s(), i = (O === "top" ? c + 2 + Math.round(l * .5) : O === "center" ? c + P / 2 : c + P - 2 - Math.round(l * .35)) + r, a = i +
|
|
2981
|
-
e.save(), e.strokeStyle = T ?
|
|
3017
|
+
let { x: t, width: n } = s(), i = (O === "top" ? c + 2 + Math.round(l * .5) : O === "center" ? c + P / 2 : c + P - 2 - Math.round(l * .35)) + r, a = i + B(i, .5, S);
|
|
3018
|
+
e.save(), e.strokeStyle = T ? w(T) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, a), e.lineTo(t + n, a), e.stroke(), e.restore();
|
|
2982
3019
|
}
|
|
2983
|
-
if (
|
|
2984
|
-
let t =
|
|
3020
|
+
if (q.includes("\n")) {
|
|
3021
|
+
let t = q.split("\n"), n = Fr(R.size, x, 1.2, R.name ?? void 0), i = t.length * n, a;
|
|
2985
3022
|
O === "top" ? (a = c + 2, e.textBaseline = "top") : O === "center" ? (a = c + (P - i) / 2, e.textBaseline = "top") : (a = c + P - i - 2, e.textBaseline = "top");
|
|
2986
|
-
for (let i = 0; i < t.length; i++) e.fillText(t[i],
|
|
3023
|
+
for (let i = 0; i < t.length; i++) e.fillText(t[i], W, a + i * n + r);
|
|
2987
3024
|
} else {
|
|
2988
3025
|
let { baseline: t, textY: n } = Yr({
|
|
2989
3026
|
alignH: D,
|
|
@@ -2996,20 +3033,20 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2996
3033
|
paddingX: 3,
|
|
2997
3034
|
paddingY: 2
|
|
2998
3035
|
});
|
|
2999
|
-
e.textBaseline = t, e.fillText(
|
|
3036
|
+
e.textBaseline = t, e.fillText(me, W, n + r);
|
|
3000
3037
|
}
|
|
3001
3038
|
}
|
|
3002
|
-
let
|
|
3003
|
-
if (L.showPhonetic &&
|
|
3004
|
-
let t = Ir(m, x), n = Rr(e,
|
|
3039
|
+
let xe = L.value.type === "text" ? L.value.phoneticRuns : void 0;
|
|
3040
|
+
if (L.showPhonetic && xe && xe.length > 0 && !q.includes("\n")) {
|
|
3041
|
+
let t = Ir(m, x), n = Rr(e, q, t), r;
|
|
3005
3042
|
r = D === "right" ? I + M - 3 - n : D === "center" ? I + M / 2 - n / 2 : I + N;
|
|
3006
|
-
let i = T ?
|
|
3007
|
-
Lr(e,
|
|
3043
|
+
let i = T ? w(T) : "#000000";
|
|
3044
|
+
Lr(e, xe, L.value.type === "text" ? L.value.phoneticPr : void 0, q, t, g, r, c, x, i);
|
|
3008
3045
|
}
|
|
3009
|
-
e.restore(),
|
|
3046
|
+
e.restore(), q && t.onTextRun && t.onTextRun({
|
|
3010
3047
|
sheetName: t.worksheet.name,
|
|
3011
3048
|
cellRef: cr(r, s),
|
|
3012
|
-
text:
|
|
3049
|
+
text: q,
|
|
3013
3050
|
x: I,
|
|
3014
3051
|
y: c,
|
|
3015
3052
|
width: M,
|
|
@@ -3035,38 +3072,38 @@ function _i(e, t) {
|
|
|
3035
3072
|
function vi(e) {
|
|
3036
3073
|
let t = gi.get(e);
|
|
3037
3074
|
if (t) return t;
|
|
3038
|
-
let n = _i("worksheet-cell-index", "index-worksheet-cells"), r =
|
|
3075
|
+
let n = _i("worksheet-cell-index", "index-worksheet-cells"), r = Pn(e.rows, n), i = /* @__PURE__ */ new Map();
|
|
3039
3076
|
for (let t of e.rows) {
|
|
3040
3077
|
let e = t.cells.filter((e) => e.value.type !== "empty").map((e) => e.col).sort((e, t) => e - t);
|
|
3041
3078
|
e.length > 0 && i.set(t.index, e);
|
|
3042
3079
|
}
|
|
3043
3080
|
let a = /* @__PURE__ */ new Set(), o = _i("worksheet-merge-skip-index", "expand-merged-cell-coordinates");
|
|
3044
3081
|
for (let t of e.mergeCells ?? []) {
|
|
3045
|
-
|
|
3046
|
-
for (let e = t.top; e <= t.bottom; e++) for (let n = t.left; n <= t.right; n++) e === t.top && n === t.left ||
|
|
3082
|
+
Mn(t, o, 1);
|
|
3083
|
+
for (let e = t.top; e <= t.bottom; e++) for (let n = t.left; n <= t.right; n++) e === t.top && n === t.left || Fn(a, `${e}:${n}`, o);
|
|
3047
3084
|
}
|
|
3048
3085
|
let s = /* @__PURE__ */ new Set();
|
|
3049
3086
|
if (e.autoFilter) {
|
|
3050
3087
|
let t = e.autoFilter, n = _i("worksheet-auto-filter-index", "expand-auto-filter-coordinates");
|
|
3051
|
-
|
|
3088
|
+
Mn({
|
|
3052
3089
|
top: t.top,
|
|
3053
3090
|
bottom: t.top,
|
|
3054
3091
|
left: t.left,
|
|
3055
3092
|
right: t.right
|
|
3056
3093
|
}, n);
|
|
3057
|
-
for (let e = t.left; e <= t.right; e++)
|
|
3094
|
+
for (let e = t.left; e <= t.right; e++) Fn(s, `${t.top}:${e}`, n);
|
|
3058
3095
|
}
|
|
3059
3096
|
let c = /* @__PURE__ */ new Map(), l = _i("worksheet-hyperlink-index", "index-hyperlink-coordinates");
|
|
3060
|
-
for (let t of e.hyperlinks ?? []) t.url &&
|
|
3097
|
+
for (let t of e.hyperlinks ?? []) t.url && Nn(c, `${t.row}:${t.col}`, t.url, l);
|
|
3061
3098
|
let u = /* @__PURE__ */ new Set(), d = _i("worksheet-comment-index", "index-comment-coordinates");
|
|
3062
3099
|
for (let t of e.commentRefs ?? []) {
|
|
3063
3100
|
let e = Mr(t);
|
|
3064
|
-
e &&
|
|
3101
|
+
e && Fn(u, `${e.row}:${e.col}`, d);
|
|
3065
3102
|
}
|
|
3066
3103
|
let f = {
|
|
3067
3104
|
cellMap: r,
|
|
3068
3105
|
nonEmptyColsByRow: i,
|
|
3069
|
-
cfContext:
|
|
3106
|
+
cfContext: Vn(e, r),
|
|
3070
3107
|
mergeSkipSet: a,
|
|
3071
3108
|
autoFilterCells: s,
|
|
3072
3109
|
hyperlinkMap: c,
|
|
@@ -3099,7 +3136,7 @@ function Si(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
|
3099
3136
|
let _ = d, v = f, y = /* @__PURE__ */ new Set(), b = (i, u, d, f) => {
|
|
3100
3137
|
let p = `${i}:${u}`, _ = r.get(p);
|
|
3101
3138
|
if (!_ || _.value.type === "empty" || s.has(p)) return !1;
|
|
3102
|
-
let { font: v, xf: y } = Vr(n, _.styleIndex ?? 0), b =
|
|
3139
|
+
let { font: v, xf: y } = Vr(n, _.styleIndex ?? 0), b = Yn(_, i, u, a, n.dxfs ?? []), x = Zt(_, n, b.numFmt, t.date1904).text;
|
|
3103
3140
|
if (!x || x === "0" && t.showZeros === !1 || _.value.type === "number" || y.wrapText || y.textRotation || x.includes("\n")) return !1;
|
|
3104
3141
|
let S = o.get(p), C = S?.isHeader ? S.headerRowDxf : S?.isTotals ? S.totalRowDxf : S?.isLastCol && S.lastColumnDxf != null ? S.lastColumnDxf : S?.isFirstCol && S.firstColumnDxf != null ? S.firstColumnDxf : S?.stripeDxf ?? S?.wholeTableDxf, w = C == null ? void 0 : n.dxfs?.[C], T = !!S && !S.isCustom && (S.isHeader || S.isTotals), E = v.bold || !!b.fontBold || T || !!w?.font?.bold, D = v.italic || !!b.fontItalic;
|
|
3105
3142
|
e.font = Ir(E !== v.bold || D !== v.italic ? {
|
|
@@ -3128,75 +3165,76 @@ function Ci(e, t) {
|
|
|
3128
3165
|
gi.set(t, vi(e));
|
|
3129
3166
|
}
|
|
3130
3167
|
function wi(e, t, n, r, i = {}) {
|
|
3131
|
-
let a = i.dpr ?? 1, o = i.cellScale ?? 1, s = $(t),
|
|
3132
|
-
e.clearRect(0, 0,
|
|
3133
|
-
let
|
|
3168
|
+
let a = i.dpr ?? 1, o = i.cellScale ?? 1, s = t.isChartSheet === !0, c = $(t), l = c.maximumDigitWidth, u = e.canvas.width / a, d = e.canvas.height / a;
|
|
3169
|
+
e.clearRect(0, 0, u, d), e.fillStyle = "#ffffff", e.fillRect(0, 0, u, d);
|
|
3170
|
+
let f = (e) => Math.round(e * o), p = s ? 0 : f(50), m = s ? 0 : f(22), { row: h, col: g, rows: _, cols: v } = r, y = (i.scrollOffsetX ?? 0) * o, b = (i.scrollOffsetY ?? 0) * o, { col: x, row: S } = c.axesAtScale(o), C = x.bandsToCover(1, s ? 0 : i.freezeCols ?? 0, Math.max(0, u - p)), w = S.bandsToCover(1, s ? 0 : i.freezeRows ?? 0, Math.max(0, d - m)), T = w.at(-1)?.index ?? 0, E = C.at(-1)?.index ?? 0, D = C.map(({ index: e }) => e), O = w.map(({ index: e }) => e), k = C.map(({ size: e }) => e), A = w.map(({ size: e }) => e), j = k.reduce((e, t) => e + t, 0), M = A.reduce((e, t) => e + t, 0), ee = x.bandsToCover(g, Math.min(16384, g + v - 1)), te = S.bandsToCover(h, Math.min(1048576, h + _ - 1)), N = ee.map(({ index: e }) => e), P = te.map(({ index: e }) => e), F = ee.map(({ size: e }) => e), I = te.map(({ size: e }) => e), { cellMap: L, cfContext: R, mergeSkipSet: z, autoFilterCells: ne, hyperlinkMap: V, commentCells: H, tableStyleMap: re, sparklineMap: ie, nonEmptyColsByRow: U } = vi(t), ae = /* @__PURE__ */ new Map(), oe = _i("worksheet-merge-anchor-index", "index-merge-anchor-coordinates");
|
|
3134
3171
|
for (let e of t.mergeCells ?? []) {
|
|
3135
|
-
let t =
|
|
3136
|
-
|
|
3172
|
+
let t = x.offsetOf(e.right + 1) - x.offsetOf(e.left), n = S.offsetOf(e.bottom + 1) - S.offsetOf(e.top);
|
|
3173
|
+
Nn(ae, `${e.top}:${e.left}`, {
|
|
3137
3174
|
totalW: t,
|
|
3138
3175
|
totalH: n,
|
|
3139
3176
|
right: e.right,
|
|
3140
3177
|
bottom: e.bottom
|
|
3141
|
-
},
|
|
3178
|
+
}, oe);
|
|
3142
3179
|
}
|
|
3143
|
-
let
|
|
3180
|
+
let se = N[0] ?? g, ce = N.at(-1) ?? Math.min(16384, g + v - 1), le = Si(e, t, n, L, U, R, re, ae, x, S, [...new Set([...O, ...P])], se, ce, E + 1, o, l, t.rightToLeft === !0), ue = x.bandsToCover(le.startCol, le.endCol), de = ue.map(({ index: e }) => e), fe = ue.map(({ size: e }) => e), pe = y + x.offsetOf(se) - x.offsetOf(le.startCol), me = {
|
|
3144
3181
|
worksheet: t,
|
|
3145
3182
|
styles: n,
|
|
3146
|
-
cellMap:
|
|
3147
|
-
mergeAnchorMap:
|
|
3148
|
-
mergeSkipSet:
|
|
3149
|
-
cfContext:
|
|
3150
|
-
colWidths:
|
|
3151
|
-
rowHeights:
|
|
3152
|
-
colAxis:
|
|
3153
|
-
rowAxis:
|
|
3154
|
-
frozenColWidths:
|
|
3155
|
-
frozenRowHeights:
|
|
3156
|
-
frozenW:
|
|
3157
|
-
frozenH:
|
|
3158
|
-
startRow:
|
|
3159
|
-
startCol:
|
|
3183
|
+
cellMap: L,
|
|
3184
|
+
mergeAnchorMap: ae,
|
|
3185
|
+
mergeSkipSet: z,
|
|
3186
|
+
cfContext: R,
|
|
3187
|
+
colWidths: fe,
|
|
3188
|
+
rowHeights: I,
|
|
3189
|
+
colAxis: x,
|
|
3190
|
+
rowAxis: S,
|
|
3191
|
+
frozenColWidths: k,
|
|
3192
|
+
frozenRowHeights: A,
|
|
3193
|
+
frozenW: j,
|
|
3194
|
+
frozenH: M,
|
|
3195
|
+
startRow: h,
|
|
3196
|
+
startCol: g,
|
|
3160
3197
|
cs: o,
|
|
3161
3198
|
dpr: a,
|
|
3162
|
-
autoFilterCells:
|
|
3163
|
-
hyperlinkMap:
|
|
3164
|
-
commentCells:
|
|
3165
|
-
tableStyleMap:
|
|
3166
|
-
sparklineMap:
|
|
3167
|
-
overflowTextAnchors:
|
|
3168
|
-
mdw:
|
|
3199
|
+
autoFilterCells: ne,
|
|
3200
|
+
hyperlinkMap: V,
|
|
3201
|
+
commentCells: H,
|
|
3202
|
+
tableStyleMap: re,
|
|
3203
|
+
sparklineMap: ie,
|
|
3204
|
+
overflowTextAnchors: le.anchorKeys,
|
|
3205
|
+
mdw: l,
|
|
3169
3206
|
onTextRun: i.onTextRun,
|
|
3170
3207
|
rtl: t.rightToLeft === !0,
|
|
3171
|
-
canvasW:
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3208
|
+
canvasW: u,
|
|
3209
|
+
threeD: i.threeD
|
|
3210
|
+
}, he = p, W = m, G = he + j, K = W + M, ge = Math.max(0, u - G), _e = Math.max(0, d - K);
|
|
3211
|
+
T > 0 && E > 0 && hi(e, me, 1, 1, k, A, D, O, 0, 0, he, W, he, W, j, M), T > 0 && hi(e, me, 1, le.startCol, fe, A, de, O, pe, 0, G, W, G, W, ge, M), E > 0 && hi(e, me, h, 1, k, I, D, P, 0, b, he, K, he, K, j, _e), s || hi(e, me, h, le.startCol, fe, I, de, P, pe, b, G, K, G, K, ge, _e), Ei(e, t, x, S, i.loadedImages, o, h, g, y, b, G, K, ge, _e, t.rightToLeft === !0, u, i.threeD, i.regionMap), !s && t.slicers && t.slicers.length > 0 && da(e, t, x, S, o, h, g, y, b, G, K, ge, _e, t.rightToLeft === !0, u), s || Ti(e, u, d, h, g, _, v, F, I, N, P, y, b, k, A, D, O, j, M, p, m, o, a, i.selectedRowRange ?? null, i.selectedColRange ?? null, t.rightToLeft === !0);
|
|
3212
|
+
let ve = t.rightToLeft === !0;
|
|
3213
|
+
if (T > 0) {
|
|
3176
3214
|
e.save(), e.strokeStyle = Sr, e.lineWidth = .5, e.beginPath();
|
|
3177
|
-
let t =
|
|
3178
|
-
e.moveTo(0, t), e.lineTo(
|
|
3215
|
+
let t = K + B(K, .5, a);
|
|
3216
|
+
e.moveTo(0, t), e.lineTo(u, t), e.stroke(), e.restore();
|
|
3179
3217
|
}
|
|
3180
|
-
if (
|
|
3218
|
+
if (E > 0) {
|
|
3181
3219
|
e.save(), e.strokeStyle = Sr, e.lineWidth = .5, e.beginPath();
|
|
3182
|
-
let t =
|
|
3183
|
-
e.moveTo(n,
|
|
3220
|
+
let t = ve ? u - G : G, n = t + B(t, .5, a);
|
|
3221
|
+
e.moveTo(n, m), e.lineTo(n, d), e.stroke(), e.restore();
|
|
3184
3222
|
}
|
|
3185
3223
|
}
|
|
3186
3224
|
function Ti(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T) {
|
|
3187
3225
|
let E = "#f8f9fa", D = "#e8eaed", O = "#caddf6", k = "#c8ccd0", A = "#5b9bd5", j = "#444", M = (e) => !w || e < w.start || e > w.end ? E : w.strong ? O : D, ee = (e) => !w || e < w.start || e > w.end ? k : w.strong ? A : k, te = (e) => !C || e < C.start || e > C.end ? E : C.strong ? O : D, N = (e) => !C || e < C.start || e > C.end ? k : C.strong ? A : k, P = `${Math.max(1, Math.round(11 * x))}px ${mr}`, F = y + _, I = b + v, L = .5 / S, R = (e, n) => T ? br(e, n, t) : e, z = T ? t - y : 0;
|
|
3188
3226
|
e.fillStyle = E, e.fillRect(z, 0, y, b), e.strokeStyle = k, e.lineWidth = .5, e.beginPath();
|
|
3189
|
-
let ne = T ? z +
|
|
3227
|
+
let ne = T ? z + B(z, .5, S) : z + y - L;
|
|
3190
3228
|
e.moveTo(ne, 0), e.lineTo(ne, b), e.moveTo(z, b - L), e.lineTo(z + y, b - L), e.stroke(), e.font = P, e.fillStyle = j;
|
|
3191
|
-
let
|
|
3229
|
+
let V = (t, n, r) => {
|
|
3192
3230
|
let i = R(n, r);
|
|
3193
3231
|
e.fillStyle = M(t), e.fillRect(i, 0, r, b), e.strokeStyle = ee(t), e.lineWidth = .5, e.beginPath();
|
|
3194
|
-
let a = i +
|
|
3232
|
+
let a = i + B(i, .5, S);
|
|
3195
3233
|
e.moveTo(a, 0), e.lineTo(a, b), e.moveTo(i, b - L), e.lineTo(i + r, b - L), e.stroke(), e.fillStyle = j, e.textAlign = "center", e.textBaseline = "middle", e.fillText(ai(t), i + r / 2, b / 2);
|
|
3196
|
-
},
|
|
3234
|
+
}, H = (t, n, r) => {
|
|
3197
3235
|
let i = z;
|
|
3198
3236
|
e.fillStyle = te(t), e.fillRect(i, n, y, r), e.strokeStyle = N(t), e.lineWidth = .5, e.beginPath();
|
|
3199
|
-
let a = n +
|
|
3237
|
+
let a = n + B(n, .5, S), o = T ? i + B(i, .5, S) : i + y - L;
|
|
3200
3238
|
e.moveTo(o, n), e.lineTo(o, n + r), e.moveTo(i, a), e.lineTo(i + y, a), e.stroke(), e.fillStyle = j, e.textBaseline = "middle";
|
|
3201
3239
|
let s = Math.max(2, Math.round(4 * x));
|
|
3202
3240
|
T ? (e.textAlign = "left", e.fillText(String(t), i + s, n + r / 2)) : (e.textAlign = "right", e.fillText(String(t), i + y - s, n + r / 2));
|
|
@@ -3204,55 +3242,55 @@ function Ti(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S,
|
|
|
3204
3242
|
if (p.length > 0) {
|
|
3205
3243
|
e.save(), e.beginPath(), e.rect(R(y, _), 0, _, b), e.clip();
|
|
3206
3244
|
let t = y;
|
|
3207
|
-
for (let e = 0; e < p.length; e++)
|
|
3245
|
+
for (let e = 0; e < p.length; e++) V(h[e], t, p[e]), t += p[e];
|
|
3208
3246
|
e.restore();
|
|
3209
3247
|
}
|
|
3210
3248
|
e.save(), e.beginPath(), e.rect(R(F, t - F), 0, t - F, b), e.clip();
|
|
3211
3249
|
let re = F - d;
|
|
3212
3250
|
for (let e = 0; e < s.length; e++) {
|
|
3213
3251
|
let n = s[e];
|
|
3214
|
-
re + n > F && re < t &&
|
|
3252
|
+
re + n > F && re < t && V(l[e], re, n), re += n;
|
|
3215
3253
|
}
|
|
3216
3254
|
if (e.restore(), m.length > 0) {
|
|
3217
3255
|
e.save(), e.beginPath(), e.rect(z, b, y, v), e.clip();
|
|
3218
3256
|
let t = b;
|
|
3219
|
-
for (let e = 0; e < m.length; e++)
|
|
3257
|
+
for (let e = 0; e < m.length; e++) H(g[e], t, m[e]), t += m[e];
|
|
3220
3258
|
e.restore();
|
|
3221
3259
|
}
|
|
3222
3260
|
e.save(), e.beginPath(), e.rect(z, I, y, n - I), e.clip();
|
|
3223
|
-
let
|
|
3261
|
+
let ie = I - f;
|
|
3224
3262
|
for (let e = 0; e < c.length; e++) {
|
|
3225
3263
|
let t = c[e];
|
|
3226
|
-
|
|
3264
|
+
ie + t > I && ie < n && H(u[e], ie, t), ie += t;
|
|
3227
3265
|
}
|
|
3228
3266
|
e.restore();
|
|
3229
3267
|
}
|
|
3230
|
-
function Ei(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
3231
|
-
let
|
|
3232
|
-
if (i) for (let e of t.images ?? [])
|
|
3268
|
+
function Ei(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _) {
|
|
3269
|
+
let v = [], y = 0;
|
|
3270
|
+
if (i) for (let e of t.images ?? []) v.push({
|
|
3233
3271
|
kind: "image",
|
|
3234
3272
|
zOrder: e.zOrder ?? 2 ** 53 - 1,
|
|
3235
|
-
fallbackOrder:
|
|
3273
|
+
fallbackOrder: y++,
|
|
3236
3274
|
anchor: e
|
|
3237
3275
|
});
|
|
3238
|
-
for (let e of t.shapeGroups ?? []) for (let t of e.shapes)
|
|
3276
|
+
for (let e of t.shapeGroups ?? []) for (let t of e.shapes) v.push({
|
|
3239
3277
|
kind: "shape",
|
|
3240
3278
|
zOrder: t.zOrder ?? 2 ** 53 - 1,
|
|
3241
|
-
fallbackOrder:
|
|
3279
|
+
fallbackOrder: y++,
|
|
3242
3280
|
anchor: e,
|
|
3243
3281
|
shape: t
|
|
3244
3282
|
});
|
|
3245
|
-
for (let e of t.charts ?? [])
|
|
3283
|
+
for (let e of t.charts ?? []) v.push({
|
|
3246
3284
|
kind: "chart",
|
|
3247
3285
|
zOrder: e.zOrder ?? 2 ** 53 - 1,
|
|
3248
|
-
fallbackOrder:
|
|
3286
|
+
fallbackOrder: y++,
|
|
3249
3287
|
anchor: e
|
|
3250
3288
|
});
|
|
3251
|
-
|
|
3252
|
-
for (let
|
|
3253
|
-
...
|
|
3254
|
-
shapes: [
|
|
3255
|
-
}]) : Qi(e, t, n, r, a, o, s, c, l, u, d, f, p, m, h, [
|
|
3289
|
+
v.sort((e, t) => e.zOrder - t.zOrder || e.fallbackOrder - t.fallbackOrder);
|
|
3290
|
+
for (let y of v) y.kind === "image" ? ki(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, [y.anchor]) : y.kind === "shape" ? Ai(e, t, n, r, a, o, s, c, l, u, d, f, p, i, m, h, [{
|
|
3291
|
+
...y.anchor,
|
|
3292
|
+
shapes: [y.shape]
|
|
3293
|
+
}]) : Qi(e, t, n, r, a, o, s, c, l, u, d, f, p, m, h, [y.anchor], g, _);
|
|
3256
3294
|
}
|
|
3257
3295
|
function Di(e, t) {
|
|
3258
3296
|
return e.offsetOf(t);
|
|
@@ -3269,10 +3307,10 @@ function ki(e, t, n, r, i, o, s, c, l, u, d, f, p, m, h, g, _ = t.images) {
|
|
|
3269
3307
|
for (let t of _) {
|
|
3270
3308
|
let s = i.get(dr(t.imagePath, t.duotone));
|
|
3271
3309
|
if (!s) continue;
|
|
3272
|
-
let c = t.fromCol + 1, _ = t.fromRow + 1, x = Di(n, c) + t.fromColOff * o /
|
|
3273
|
-
if (ur(t)) C = t.nativeExtCx * o /
|
|
3310
|
+
let c = t.fromCol + 1, _ = t.fromRow + 1, x = Di(n, c) + t.fromColOff * o / J, S = Oi(r, _) + t.fromRowOff * o / J, C, w;
|
|
3311
|
+
if (ur(t)) C = t.nativeExtCx * o / J, w = t.nativeExtCy * o / J;
|
|
3274
3312
|
else {
|
|
3275
|
-
let e = t.toCol + 1, i = t.toRow + 1, a = Di(n, e) + t.toColOff * o /
|
|
3313
|
+
let e = t.toCol + 1, i = t.toRow + 1, a = Di(n, e) + t.toColOff * o / J, s = Oi(r, i) + t.toRowOff * o / J;
|
|
3276
3314
|
C = a - x, w = s - S;
|
|
3277
3315
|
}
|
|
3278
3316
|
if (C <= 0 || w <= 0) continue;
|
|
@@ -3288,10 +3326,10 @@ function Ai(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.shapeGroups ??
|
|
|
3288
3326
|
let y = xr(l, d, h, m);
|
|
3289
3327
|
e.rect(y, u, d, f), e.clip();
|
|
3290
3328
|
for (let t of g) {
|
|
3291
|
-
let a = t.fromCol + 1, o = t.fromRow + 1, g = Di(n, a) + t.fromColOff * i /
|
|
3292
|
-
if (ur(t)) x = t.nativeExtCx * i /
|
|
3329
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, g = Di(n, a) + t.fromColOff * i / J, b = Oi(r, o) + t.fromRowOff * i / J, x, S;
|
|
3330
|
+
if (ur(t)) x = t.nativeExtCx * i / J, S = t.nativeExtCy * i / J;
|
|
3293
3331
|
else {
|
|
3294
|
-
let e = t.toCol + 1, a = t.toRow + 1, o = Di(n, e) + t.toColOff * i /
|
|
3332
|
+
let e = t.toCol + 1, a = t.toRow + 1, o = Di(n, e) + t.toColOff * i / J, s = Oi(r, a) + t.toRowOff * i / J;
|
|
3295
3333
|
x = o - g, S = s - b;
|
|
3296
3334
|
}
|
|
3297
3335
|
if (x <= 0 || S <= 0) continue;
|
|
@@ -3344,11 +3382,11 @@ function ji(e, t, n, r, i, o, s, c) {
|
|
|
3344
3382
|
Vi(e, t, i, o);
|
|
3345
3383
|
}
|
|
3346
3384
|
else if (t.geom.type === "preset") {
|
|
3347
|
-
let n =
|
|
3385
|
+
let n = C(t.fill ?? (t.fillColor ? {
|
|
3348
3386
|
fillType: "solid",
|
|
3349
3387
|
color: t.fillColor
|
|
3350
3388
|
} : null), e, 0, 0, i, o, t.rot), r = t.strokeColor && t.strokeWidth > 0 ? () => Ui(e, t, i, o) : null;
|
|
3351
|
-
|
|
3389
|
+
x(e, t.geom.name, 0, 0, i, o, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, o), Vi(e, t, i, o));
|
|
3352
3390
|
} else if (t.geom.type === "image") {
|
|
3353
3391
|
let n = c?.get(dr(t.geom.imagePath, t.geom.duotone));
|
|
3354
3392
|
if (n) {
|
|
@@ -3395,7 +3433,7 @@ async function zi(e, t) {
|
|
|
3395
3433
|
if (n.length !== 0) {
|
|
3396
3434
|
await t.loadMathJax();
|
|
3397
3435
|
for (let e of n) if (!Mi.has(e.nodes)) try {
|
|
3398
|
-
let n = await t.mathMLToSvg(
|
|
3436
|
+
let n = await t.mathMLToSvg(D(e.nodes, e.display)), r = await Pi(Ii(He(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
3399
3437
|
Mi.set(e.nodes, {
|
|
3400
3438
|
img: r,
|
|
3401
3439
|
widthEm: n.widthEm,
|
|
@@ -3408,10 +3446,10 @@ async function zi(e, t) {
|
|
|
3408
3446
|
}
|
|
3409
3447
|
function Bi(e, t, n, r, i) {
|
|
3410
3448
|
if (n <= 0 || r <= 0 || t.paragraphs.length === 0) return;
|
|
3411
|
-
let a = t.lIns /
|
|
3449
|
+
let a = t.lIns / J * i, o = t.rIns / J * i, s = t.tIns / J * i, c = t.bIns / J * i, l = Math.max(0, n - a - o), u = Math.max(0, r - s - c);
|
|
3412
3450
|
if (l <= 0 || u <= 0) return;
|
|
3413
3451
|
let d = (e) => {
|
|
3414
|
-
let t = (e.size > 0 ? e.size : yr) *
|
|
3452
|
+
let t = (e.size > 0 ? e.size : yr) * Re * i, n = vr(e.fontFace);
|
|
3415
3453
|
return {
|
|
3416
3454
|
font: `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${t}px ${n}`,
|
|
3417
3455
|
px: t
|
|
@@ -3423,13 +3461,13 @@ function Bi(e, t, n, r, i) {
|
|
|
3423
3461
|
return e.font = r, i > 0 ? i : n * .85;
|
|
3424
3462
|
}, p = t.wrap !== "none", m = [];
|
|
3425
3463
|
for (let n of t.paragraphs) {
|
|
3426
|
-
let r = n.align || "l", a = (n.marL ?? 0) /
|
|
3464
|
+
let r = n.align || "l", a = (n.marL ?? 0) / J * i, o = (n.marR ?? 0) / J * i, s = (n.indent ?? 0) / J * 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, x = 0, S = !1, C = n.spaceLine?.type === "pct", w = (e) => {
|
|
3427
3465
|
let r = e;
|
|
3428
|
-
return n.spaceLine && (n.spaceLine.type === "pct" ? r *= n.spaceLine.val / 1e5 : r = n.spaceLine.val *
|
|
3466
|
+
return n.spaceLine && (n.spaceLine.type === "pct" ? r *= n.spaceLine.val / 1e5 : r = n.spaceLine.val * Re * i), t.autoFit === "norm" && t.lnSpcReduction != null && n.spaceLine?.type !== "pts" && (r *= 1 - t.lnSpcReduction), r;
|
|
3429
3467
|
}, T = () => {
|
|
3430
3468
|
if (b === 0) {
|
|
3431
|
-
let e = (E || yr) *
|
|
3432
|
-
b = C ? n : Math.max(n, t), x = f(`${e}px ${vr(
|
|
3469
|
+
let e = (E || yr) * Re * i, t = Math.max(V(D, e), V(O, e)), n = e * 1.2;
|
|
3470
|
+
b = C ? n : Math.max(n, t), x = f(`${e}px ${vr(D)}`, e);
|
|
3433
3471
|
}
|
|
3434
3472
|
b = w(b), m.push({
|
|
3435
3473
|
segs: v,
|
|
@@ -3440,7 +3478,7 @@ function Bi(e, t, n, r, i) {
|
|
|
3440
3478
|
leftInset: g(),
|
|
3441
3479
|
availW: _()
|
|
3442
3480
|
}), h = !0, v = [], y = 0, b = 0, x = 0, S = !1;
|
|
3443
|
-
}, E = 0,
|
|
3481
|
+
}, E = 0, D, O;
|
|
3444
3482
|
for (let t of n.runs) {
|
|
3445
3483
|
if (t.type === "break") {
|
|
3446
3484
|
T();
|
|
@@ -3449,7 +3487,7 @@ function Bi(e, t, n, r, i) {
|
|
|
3449
3487
|
if (t.type === "math") {
|
|
3450
3488
|
let e = Mi.get(t.nodes);
|
|
3451
3489
|
if (!e) continue;
|
|
3452
|
-
let n = (t.fontSize ?? (E || yr)) *
|
|
3490
|
+
let n = (t.fontSize ?? (E || yr)) * Re * i, o = e.widthEm * n, s = e.ascentEm * n, c = e.descentEm * n, l = t.color ?? "#000000";
|
|
3453
3491
|
if (t.display) {
|
|
3454
3492
|
T(), m.push({
|
|
3455
3493
|
segs: [{
|
|
@@ -3479,13 +3517,13 @@ function Bi(e, t, n, r, i) {
|
|
|
3479
3517
|
}), y += o, b = Math.max(b, s + c), x = Math.max(x, s), S = !0;
|
|
3480
3518
|
continue;
|
|
3481
3519
|
}
|
|
3482
|
-
E = t.size > 0 ? t.size : yr,
|
|
3483
|
-
let { font: n, px: o } = d(t), s = t.color ?? "#000000", c = Math.max(
|
|
3520
|
+
E = t.size > 0 ? t.size : yr, D = t.fontFace, O = t.fontFaceEa;
|
|
3521
|
+
let { font: n, px: o } = d(t), s = t.color ?? "#000000", c = Math.max(V(t.fontFace, o), V(t.fontFaceEa, o)), l = o * 1.2, g = C ? l : Math.max(l, c);
|
|
3484
3522
|
b = Math.max(b, g), x = Math.max(x, f(n, o)), e.font = n;
|
|
3485
|
-
let
|
|
3486
|
-
for (let t = 0; t <
|
|
3523
|
+
let k = t.text.split("\n");
|
|
3524
|
+
for (let t = 0; t < k.length; t++) {
|
|
3487
3525
|
t > 0 && T();
|
|
3488
|
-
let r =
|
|
3526
|
+
let r = k[t];
|
|
3489
3527
|
if (!r) continue;
|
|
3490
3528
|
if (!p) {
|
|
3491
3529
|
let t = e.measureText(r).width;
|
|
@@ -3554,7 +3592,7 @@ function Bi(e, t, n, r, i) {
|
|
|
3554
3592
|
}
|
|
3555
3593
|
}
|
|
3556
3594
|
function Vi(e, t, n, r) {
|
|
3557
|
-
let i =
|
|
3595
|
+
let i = C(t.fill ?? (t.fillColor ? {
|
|
3558
3596
|
fillType: "solid",
|
|
3559
3597
|
color: t.fillColor
|
|
3560
3598
|
} : null), e, 0, 0, n, r, t.rot);
|
|
@@ -3579,8 +3617,8 @@ function Hi(e) {
|
|
|
3579
3617
|
function Ui(e, t, n, r) {
|
|
3580
3618
|
let i = Hi(t);
|
|
3581
3619
|
if (i) {
|
|
3582
|
-
if (
|
|
3583
|
-
let a =
|
|
3620
|
+
if (oe(e, i, 1 / J), i.fill) {
|
|
3621
|
+
let a = C(i.fill, e, 0, 0, n, r, t.rot);
|
|
3584
3622
|
a && (e.strokeStyle = a);
|
|
3585
3623
|
}
|
|
3586
3624
|
e.stroke();
|
|
@@ -3679,7 +3717,7 @@ function qi(e, t, n, r, i, a, o = 1) {
|
|
|
3679
3717
|
];
|
|
3680
3718
|
for (let { edge: c, x1: l, y1: u, x2: d, y2: f, kind: p } of s) {
|
|
3681
3719
|
if (!c || !c.style || c.style === "none") continue;
|
|
3682
|
-
let s = c.color ?
|
|
3720
|
+
let s = c.color ? w(c.color) : "#000000";
|
|
3683
3721
|
if (c.style === "double" && p === "d") {
|
|
3684
3722
|
e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]);
|
|
3685
3723
|
let t = d - l, n = f - u, r = Math.hypot(t, n), i = -n / r * 1, a = t / r * 1;
|
|
@@ -3702,7 +3740,7 @@ function qi(e, t, n, r, i, a, o = 1) {
|
|
|
3702
3740
|
e.lineWidth = m;
|
|
3703
3741
|
let h = Yi(c.style);
|
|
3704
3742
|
e.setLineDash(h);
|
|
3705
|
-
let g = p === "v" ?
|
|
3743
|
+
let g = p === "v" ? B(l, m, o) : 0, _ = p === "h" ? B(u, m, o) : 0;
|
|
3706
3744
|
e.moveTo(l + g, u + _), e.lineTo(d + g, f + _), e.stroke(), e.setLineDash([]);
|
|
3707
3745
|
}
|
|
3708
3746
|
}
|
|
@@ -3719,7 +3757,7 @@ function Ji(e) {
|
|
|
3719
3757
|
}
|
|
3720
3758
|
}
|
|
3721
3759
|
function Yi(e) {
|
|
3722
|
-
return
|
|
3760
|
+
return ze(e);
|
|
3723
3761
|
}
|
|
3724
3762
|
function Xi(e) {
|
|
3725
3763
|
switch (e) {
|
|
@@ -3743,22 +3781,22 @@ function Zi(e, t) {
|
|
|
3743
3781
|
let n = Xi(e?.style), r = Xi(t?.style);
|
|
3744
3782
|
return n === 0 && r === 0 ? null : n >= r ? e ?? null : t ?? null;
|
|
3745
3783
|
}
|
|
3746
|
-
function Qi(e, t, n, r, i, a, o, s, c, l, u, f, p, m, h, g = t.charts) {
|
|
3784
|
+
function Qi(e, t, n, r, i, a, o, s, c, l, u, f, p, m, h, g = t.charts, _, v) {
|
|
3747
3785
|
if (f <= 0 || p <= 0) return;
|
|
3748
|
-
let
|
|
3786
|
+
let y = Di(n, o), b = Oi(r, a), x = xr(l, f, h, m);
|
|
3749
3787
|
for (let t of g) {
|
|
3750
|
-
let a = t.fromCol + 1, o = t.fromRow + 1, g = t.toCol + 1,
|
|
3751
|
-
if (
|
|
3752
|
-
let
|
|
3753
|
-
if (
|
|
3754
|
-
e.save(), e.beginPath(), e.rect(
|
|
3755
|
-
let
|
|
3788
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, g = t.toCol + 1, S = t.toRow + 1, C = Di(n, a) + t.fromColOff * i / J, w = Oi(r, o) + t.fromRowOff * i / J, T = Di(n, g) + t.toColOff * i / J, E = Oi(r, S) + t.toRowOff * i / J, D = T - C, O = E - w;
|
|
3789
|
+
if (D <= 0 || O <= 0) continue;
|
|
3790
|
+
let k = xr(l + (C - y) - s, D, h, m), A = u + (w - b) - c;
|
|
3791
|
+
if (k + D < x || k > x + f || A + O < u || A > u + p) continue;
|
|
3792
|
+
e.save(), e.beginPath(), e.rect(x, u, f, p), e.clip();
|
|
3793
|
+
let j = Re * i;
|
|
3756
3794
|
d(e, t.chart, {
|
|
3757
|
-
x:
|
|
3758
|
-
y:
|
|
3759
|
-
w:
|
|
3760
|
-
h:
|
|
3761
|
-
},
|
|
3795
|
+
x: k,
|
|
3796
|
+
y: A,
|
|
3797
|
+
w: D,
|
|
3798
|
+
h: O
|
|
3799
|
+
}, j, 0, _, v), e.restore();
|
|
3762
3800
|
}
|
|
3763
3801
|
}
|
|
3764
3802
|
var $i = "600 12px \"Meiryo UI\", \"Segoe UI\", sans-serif", ea = "11px \"Meiryo UI\", \"Segoe UI\", sans-serif", ta = "#FFFFFF", na = "#BFBFBF", ra = "#F2F2F2", ia = "#404040", aa = "#FFFFFF", oa = "#000000", sa = "#A5A5A5", ca = "#E7E6E6", la = "#A6A6A6", ua = "#C6C6C6";
|
|
@@ -3768,10 +3806,10 @@ function da(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
3768
3806
|
if (!h) return;
|
|
3769
3807
|
let g = Di(n, o), _ = Oi(r, a), v = xr(l, d, m, p);
|
|
3770
3808
|
for (let t of h) {
|
|
3771
|
-
let a = t.fromCol + 1, o = t.fromRow + 1, h = t.toCol + 1, y = t.toRow + 1, b = Di(n, a) + t.fromColOff * i /
|
|
3809
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, h = t.toCol + 1, y = t.toRow + 1, b = Di(n, a) + t.fromColOff * i / J, x = Oi(r, o) + t.fromRowOff * i / J, S = Di(n, h) + t.toColOff * i / J, C = Oi(r, y) + t.toRowOff * i / J, w = S - b, T = C - x;
|
|
3772
3810
|
if (w <= 0 || T <= 0) continue;
|
|
3773
|
-
let E = xr(l + (b - g) - s, w, m, p),
|
|
3774
|
-
E + w < v || E > v + d ||
|
|
3811
|
+
let E = xr(l + (b - g) - s, w, m, p), D = u + (x - _) - c;
|
|
3812
|
+
E + w < v || E > v + d || D + T < u || D > u + f || (e.save(), e.beginPath(), e.rect(v, u, d, f), e.clip(), fa(e, t.caption, t.items, E, D, w, T, i, t.style), e.restore());
|
|
3775
3813
|
}
|
|
3776
3814
|
}
|
|
3777
3815
|
function fa(e, t, n, r, i, a, o, s, c) {
|
|
@@ -3826,7 +3864,7 @@ function va(e, t) {
|
|
|
3826
3864
|
}
|
|
3827
3865
|
function ya(e, t, n, r, i) {
|
|
3828
3866
|
if (!n) return !0;
|
|
3829
|
-
let a = r ?? $(t), o = i?.scale ?? 1, { col: s, row: c } = a.axesAtScale(o), l = (e, t, n) => e.offsetOf(t + 1) + n * o /
|
|
3867
|
+
let a = r ?? $(t), o = i?.scale ?? 1, { col: s, row: c } = a.axesAtScale(o), l = (e, t, n) => e.offsetOf(t + 1) + n * o / J, u = l(s, e.fromCol, e.fromColOff), d = l(c, e.fromRow, e.fromRowOff), f = ur(e), p = f ? u + e.nativeExtCx * o / J : l(s, e.toCol, e.toColOff), m = f ? d + e.nativeExtCy * o / J : l(c, e.toRow, e.toRowOff);
|
|
3830
3868
|
if (p <= u || m <= d) return !1;
|
|
3831
3869
|
let h = i ? a.effectiveFrozenBands({
|
|
3832
3870
|
scale: o,
|
|
@@ -3846,7 +3884,7 @@ function ya(e, t, n, r, i) {
|
|
|
3846
3884
|
return g(u, p, s.offsetOf(h.cols + 1), s.offsetOf(n.col), s.offsetOf(n.col + n.cols)) && g(d, m, c.offsetOf(h.rows + 1), c.offsetOf(n.row), c.offsetOf(n.row + n.rows));
|
|
3847
3885
|
}
|
|
3848
3886
|
async function ba(e, t, n, r, i = 0, a = 0, o = null, c = null, l) {
|
|
3849
|
-
let u = t === "image/svg+xml", d =
|
|
3887
|
+
let u = t === "image/svg+xml", d = b(t, o, i, a), f = () => Ve(e, t, c, r, {
|
|
3850
3888
|
widthPt: d.widthPt,
|
|
3851
3889
|
heightPt: d.heightPt,
|
|
3852
3890
|
offscreenFactory: l
|
|
@@ -3854,7 +3892,7 @@ async function ba(e, t, n, r, i = 0, a = 0, o = null, c = null, l) {
|
|
|
3854
3892
|
svgImagePath: n,
|
|
3855
3893
|
srcRect: o
|
|
3856
3894
|
};
|
|
3857
|
-
if (
|
|
3895
|
+
if (fe(p)) try {
|
|
3858
3896
|
return await s(p.svgImagePath, r);
|
|
3859
3897
|
} catch {
|
|
3860
3898
|
return u ? s(e, r) : f();
|
|
@@ -3874,8 +3912,8 @@ async function xa(e, t, n, r) {
|
|
|
3874
3912
|
imagePath: t.imagePath,
|
|
3875
3913
|
mimeType: t.mimeType,
|
|
3876
3914
|
svgImagePath: t.svgImagePath,
|
|
3877
|
-
widthPt: t.nativeExtCx > 0 ? t.nativeExtCx /
|
|
3878
|
-
heightPt: t.nativeExtCy > 0 ? t.nativeExtCy /
|
|
3915
|
+
widthPt: t.nativeExtCx > 0 ? t.nativeExtCx / Be : 0,
|
|
3916
|
+
heightPt: t.nativeExtCy > 0 ? t.nativeExtCy / Be : 0,
|
|
3879
3917
|
srcRect: t.srcRect ?? null,
|
|
3880
3918
|
duotone: t.duotone ?? null
|
|
3881
3919
|
});
|
|
@@ -3884,8 +3922,8 @@ async function xa(e, t, n, r) {
|
|
|
3884
3922
|
imagePath: e.geom.imagePath,
|
|
3885
3923
|
mimeType: e.geom.mimeType,
|
|
3886
3924
|
svgImagePath: e.geom.svgImagePath,
|
|
3887
|
-
widthPt: t.nativeExtCx > 0 ? t.nativeExtCx * e.w /
|
|
3888
|
-
heightPt: t.nativeExtCy > 0 ? t.nativeExtCy * e.h /
|
|
3925
|
+
widthPt: t.nativeExtCx > 0 ? t.nativeExtCx * e.w / Be : 0,
|
|
3926
|
+
heightPt: t.nativeExtCy > 0 ? t.nativeExtCy * e.h / Be : 0,
|
|
3889
3927
|
srcRect: e.geom.srcRect ?? null,
|
|
3890
3928
|
duotone: e.geom.duotone ?? null
|
|
3891
3929
|
});
|
|
@@ -3909,7 +3947,7 @@ async function Sa(e, t, n, r = {}) {
|
|
|
3909
3947
|
}
|
|
3910
3948
|
}
|
|
3911
3949
|
async function Ca(e, t, n, r = {}) {
|
|
3912
|
-
let { ws: i, styles: a } = e, o =
|
|
3950
|
+
let { ws: i, styles: a } = e, o = N(t) ? t.clientWidth || 800 : t.width, s = N(t) ? t.clientHeight || 600 : t.height, c = r.width ?? o, l = r.height ?? s, u = /* @__PURE__ */ new Map();
|
|
3913
3951
|
if (await xa(i, u, r.fetchImage, {
|
|
3914
3952
|
viewport: n,
|
|
3915
3953
|
width: c,
|
|
@@ -3918,8 +3956,8 @@ async function Ca(e, t, n, r = {}) {
|
|
|
3918
3956
|
freezeRows: r.freezeRows,
|
|
3919
3957
|
freezeCols: r.freezeCols
|
|
3920
3958
|
}), e.math && Ri(i) && await zi(i, e.math), r[_a]?.() === !1) return;
|
|
3921
|
-
let d = r.dpr ??
|
|
3922
|
-
if (t.width !== m && (t.width = m), t.height !== h && (t.height = h),
|
|
3959
|
+
let d = r.dpr ?? F(), f = U(c * d, l * d), p = f.clamped ? d * f.scale : d, m = f.width, h = f.height;
|
|
3960
|
+
if (t.width !== m && (t.width = m), t.height !== h && (t.height = h), N(t)) {
|
|
3923
3961
|
let e = `${c}px`, n = `${l}px`;
|
|
3924
3962
|
t.style.width !== e && (t.style.width = e), t.style.height !== n && (t.style.height = n);
|
|
3925
3963
|
}
|
|
@@ -3931,7 +3969,9 @@ async function Ca(e, t, n, r = {}) {
|
|
|
3931
3969
|
wi(g, i, a, n, {
|
|
3932
3970
|
...r,
|
|
3933
3971
|
dpr: p,
|
|
3934
|
-
loadedImages: u
|
|
3972
|
+
loadedImages: u,
|
|
3973
|
+
threeD: e.threeD,
|
|
3974
|
+
regionMap: e.regionMap
|
|
3935
3975
|
});
|
|
3936
3976
|
}
|
|
3937
3977
|
function wa(e, t, n, r, i) {
|
|
@@ -3955,8 +3995,8 @@ function wa(e, t, n, r, i) {
|
|
|
3955
3995
|
//#endregion
|
|
3956
3996
|
//#region packages/xlsx/src/google-fonts.ts
|
|
3957
3997
|
var Ta = {
|
|
3958
|
-
...
|
|
3959
|
-
...
|
|
3998
|
+
...k,
|
|
3999
|
+
...M
|
|
3960
4000
|
};
|
|
3961
4001
|
function* Ea(e) {
|
|
3962
4002
|
for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
|
|
@@ -3964,8 +4004,8 @@ function* Ea(e) {
|
|
|
3964
4004
|
}
|
|
3965
4005
|
function Da(e) {
|
|
3966
4006
|
let t = /* @__PURE__ */ new Set(), n = null;
|
|
3967
|
-
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??=
|
|
3968
|
-
for (let r of
|
|
4007
|
+
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= H(r.name));
|
|
4008
|
+
for (let r of I(Ea(e), n)) t.add(r);
|
|
3969
4009
|
return t;
|
|
3970
4010
|
}
|
|
3971
4011
|
function Oa(e) {
|
|
@@ -4089,14 +4129,16 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4089
4129
|
parsedWorkbook = null;
|
|
4090
4130
|
sheetCache = /* @__PURE__ */ new Map();
|
|
4091
4131
|
sheetLoads = /* @__PURE__ */ new Map();
|
|
4092
|
-
rawParts = new
|
|
4132
|
+
rawParts = new Pe({
|
|
4093
4133
|
maxEntries: 64,
|
|
4094
|
-
maxBytes:
|
|
4134
|
+
maxBytes: ae
|
|
4095
4135
|
});
|
|
4096
4136
|
queuedImageLoads = /* @__PURE__ */ new Map();
|
|
4097
4137
|
_fetchImage = (e, t) => this.getImageWithinArchiveOperation(e, t);
|
|
4098
4138
|
resourcePolicy = null;
|
|
4099
4139
|
math;
|
|
4140
|
+
threeD;
|
|
4141
|
+
regionMap;
|
|
4100
4142
|
googleFontNames = [];
|
|
4101
4143
|
retainedFontSets = /* @__PURE__ */ new Map();
|
|
4102
4144
|
fontsDestroyed = !1;
|
|
@@ -4113,11 +4155,11 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4113
4155
|
};
|
|
4114
4156
|
resourceFailure = null;
|
|
4115
4157
|
constructor(e, t, n) {
|
|
4116
|
-
this.worker = e, this._mode = t, this.bridge = new
|
|
4158
|
+
this.worker = e, this._mode = t, this.bridge = new W(this.worker, {
|
|
4117
4159
|
correlate: (e) => "protocol" in e && e.protocol === "ooxml-pull-v1" ? e.requestId : "id" in e ? e.id : void 0,
|
|
4118
|
-
toError: (e) => "type" in e && e.type === "error" ?
|
|
4160
|
+
toError: (e) => "type" in e && e.type === "error" ? L(e) : void 0
|
|
4119
4161
|
});
|
|
4120
|
-
let r = new URL(n ??
|
|
4162
|
+
let r = new URL(n ?? ut, location.href).href;
|
|
4121
4163
|
this.bridge.post({
|
|
4122
4164
|
type: "init",
|
|
4123
4165
|
wasmUrl: r
|
|
@@ -4127,7 +4169,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4127
4169
|
return this._mode;
|
|
4128
4170
|
}
|
|
4129
4171
|
static async load(t, n = {}) {
|
|
4130
|
-
let i = r(n), a = n.mode ?? "main", o = new
|
|
4172
|
+
let i = r(n), a = n.mode ?? "main", o = new _({
|
|
4131
4173
|
enabled: !0,
|
|
4132
4174
|
format: "xlsx",
|
|
4133
4175
|
mode: a,
|
|
@@ -4143,27 +4185,27 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4143
4185
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
4144
4186
|
s = await e.arrayBuffer();
|
|
4145
4187
|
} else s = t;
|
|
4146
|
-
s =
|
|
4188
|
+
s = G(await ge(s, n.password));
|
|
4147
4189
|
let c = s === r;
|
|
4148
4190
|
o.setSourceBytes(s.byteLength), o.checkpoint("container ready");
|
|
4149
|
-
let l = a === "worker" ? (await import("./render-worker-host-
|
|
4191
|
+
let l = a === "worker" ? (await import("./render-worker-host-hZ0o4OD7.js")).createRenderWorker() : new lt(), u;
|
|
4150
4192
|
try {
|
|
4151
4193
|
return u = new e(l, a, n.wasmUrl), u.metrics = o, await u._load(s, n, i.policy, (e) => o.observeUsage(e), c), o.checkpoint("workbook index ready"), o.succeed({ sheets: u.sheetCount }), u;
|
|
4152
4194
|
} catch (e) {
|
|
4153
4195
|
let t = u;
|
|
4154
|
-
throw
|
|
4196
|
+
throw K(l, t ? () => t.destroy() : void 0), e;
|
|
4155
4197
|
}
|
|
4156
4198
|
} catch (e) {
|
|
4157
4199
|
throw o.fail(e), e;
|
|
4158
4200
|
}
|
|
4159
4201
|
}
|
|
4160
|
-
async _load(e, t = {}, n =
|
|
4202
|
+
async _load(e, t = {}, n = S(t), r, i = !1) {
|
|
4161
4203
|
this.resourceFailure = null, this.retainedSheetUsage = {
|
|
4162
4204
|
rows: 0,
|
|
4163
4205
|
cells: 0,
|
|
4164
4206
|
ownedUtf8Bytes: 0,
|
|
4165
4207
|
jsonBytes: 0
|
|
4166
|
-
}, this.sheetCache.clear(), await this.worksheetPullClient?.cancelAll("closed"), this.worksheetPullClient = null, this.generation = (this.generation ?? 0) + 1, this.resourcePolicy = n, this.workerTimeoutMs = t.workerTimeoutMs, this.math = t.math, t.math && this._mode === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for workbooks with equations.");
|
|
4208
|
+
}, this.sheetCache.clear(), await this.worksheetPullClient?.cancelAll("closed"), this.worksheetPullClient = null, this.generation = (this.generation ?? 0) + 1, this.resourcePolicy = n, this.workerTimeoutMs = t.workerTimeoutMs, this.math = t.math, this.threeD = this._mode === "worker" ? void 0 : t.threeD, this.regionMap = this._mode === "worker" ? void 0 : t.regionMap, t.math && this._mode === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for workbooks with equations."), t.threeD && this._mode === "worker" && console.warn("[ooxml] the 3-D chart addon is unavailable in mode: 'worker'; charts use their 2-D family fallback. Use mode: 'main' for authored 3-D charts."), t.regionMap && this._mode === "worker" && console.warn("[ooxml] the Region Map addon is unavailable in mode: 'worker'; geospatial charts use the unsupported-chart placeholder. Use mode: 'main' for Region Maps.");
|
|
4167
4209
|
let a = i ? e.slice(0) : e, o = await this.bridge.request((e) => this._mode === "worker" ? {
|
|
4168
4210
|
type: "parse",
|
|
4169
4211
|
id: e,
|
|
@@ -4192,13 +4234,13 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4192
4234
|
let t = this.retainedFontSets.get(e);
|
|
4193
4235
|
if (t) t.refs++;
|
|
4194
4236
|
else {
|
|
4195
|
-
let n =
|
|
4237
|
+
let n = Ne(this.googleFontNames, Ta, e);
|
|
4196
4238
|
t = {
|
|
4197
4239
|
refs: 1,
|
|
4198
4240
|
faces: null,
|
|
4199
4241
|
loading: n
|
|
4200
4242
|
}, this.retainedFontSets.set(e, t), n.then((e) => {
|
|
4201
|
-
t.faces = e, this.fontsDestroyed &&
|
|
4243
|
+
t.faces = e, this.fontsDestroyed && Me(e);
|
|
4202
4244
|
});
|
|
4203
4245
|
}
|
|
4204
4246
|
await t.loading;
|
|
@@ -4207,7 +4249,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4207
4249
|
if (n) return;
|
|
4208
4250
|
n = !0;
|
|
4209
4251
|
let r = this.retainedFontSets.get(e);
|
|
4210
|
-
r === t && (r.refs--, !(r.refs > 0) && (this.retainedFontSets.delete(e), r.faces ?
|
|
4252
|
+
r === t && (r.refs--, !(r.refs > 0) && (this.retainedFontSets.delete(e), r.faces ? Me(r.faces) : r.loading.then(Me)));
|
|
4211
4253
|
};
|
|
4212
4254
|
}
|
|
4213
4255
|
async [Ia](e) {
|
|
@@ -4223,7 +4265,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4223
4265
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.tabColor ?? null) ?? [];
|
|
4224
4266
|
}
|
|
4225
4267
|
sheetVisibility(e) {
|
|
4226
|
-
return
|
|
4268
|
+
return dt(this.parsedWorkbook?.workbook.sheets ?? [], e);
|
|
4227
4269
|
}
|
|
4228
4270
|
isHidden(e) {
|
|
4229
4271
|
return this.sheetVisibility(e) !== "visible";
|
|
@@ -4245,7 +4287,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4245
4287
|
async getResourceMetrics() {
|
|
4246
4288
|
let e = this.metrics;
|
|
4247
4289
|
if (!e) throw Error("Workbook not loaded");
|
|
4248
|
-
return
|
|
4290
|
+
return he(e, async (e) => (await this.bridge.request((e) => ({
|
|
4249
4291
|
type: "resourceUsage",
|
|
4250
4292
|
id: e
|
|
4251
4293
|
}), void 0, { timeoutMs: e })).usage);
|
|
@@ -4265,38 +4307,38 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4265
4307
|
try {
|
|
4266
4308
|
for await (let s of n.stream(e, t)) {
|
|
4267
4309
|
if (s.kind === "rows") {
|
|
4268
|
-
let e =
|
|
4269
|
-
|
|
4310
|
+
let e = Qe(i, Je(s.rows));
|
|
4311
|
+
Xe(e, "get-worksheet", void 0, s.usage), r.push(...s.rows), i = e;
|
|
4270
4312
|
continue;
|
|
4271
4313
|
}
|
|
4272
4314
|
let e = s.worksheet;
|
|
4273
4315
|
e.rows = e.parseError ? [] : r;
|
|
4274
|
-
let t =
|
|
4316
|
+
let t = tt(e, e.parseError ? {
|
|
4275
4317
|
rows: 0,
|
|
4276
4318
|
cells: 0,
|
|
4277
4319
|
ownedUtf8Bytes: 0
|
|
4278
4320
|
} : i);
|
|
4279
|
-
|
|
4280
|
-
let n =
|
|
4321
|
+
Xe(t, "get-worksheet", void 0, s.usage), qe(t.jsonBytes, "get-worksheet", void 0, s.usage);
|
|
4322
|
+
let n = Ke(this.retainedSheetUsage ?? {
|
|
4281
4323
|
rows: 0,
|
|
4282
4324
|
cells: 0,
|
|
4283
4325
|
ownedUtf8Bytes: 0,
|
|
4284
4326
|
jsonBytes: 0
|
|
4285
4327
|
}, t);
|
|
4286
|
-
|
|
4328
|
+
$e(n, "get-worksheet", void 0, s.usage), a = e, o = n;
|
|
4287
4329
|
}
|
|
4288
4330
|
if (!a || !o) throw Error(`XLSX worksheet ${e} did not produce a terminal model`);
|
|
4289
4331
|
return this.retainedSheetUsage = o, this.sheetCache.set(e, a), a;
|
|
4290
4332
|
} catch (e) {
|
|
4291
|
-
throw e instanceof
|
|
4333
|
+
throw e instanceof le && (this.resourceFailure ??= e), e;
|
|
4292
4334
|
}
|
|
4293
4335
|
}
|
|
4294
4336
|
ensureWorksheetPullClient() {
|
|
4295
4337
|
if (this.worksheetPullClient) return this.worksheetPullClient;
|
|
4296
4338
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
4297
|
-
return this.worksheetPullClient = new
|
|
4339
|
+
return this.worksheetPullClient = new et({
|
|
4298
4340
|
generation: this.generation || 1,
|
|
4299
|
-
transport: this.bridge.transport(
|
|
4341
|
+
transport: this.bridge.transport(Ze),
|
|
4300
4342
|
sharedStrings: this.parsedWorkbook.sharedStrings,
|
|
4301
4343
|
timeoutMs: this.workerTimeoutMs,
|
|
4302
4344
|
open: async (e, t, n, r) => {
|
|
@@ -4316,7 +4358,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4316
4358
|
try {
|
|
4317
4359
|
return await e();
|
|
4318
4360
|
} catch (e) {
|
|
4319
|
-
throw e instanceof
|
|
4361
|
+
throw e instanceof le && (this.resourceFailure ??= e), e;
|
|
4320
4362
|
}
|
|
4321
4363
|
}, n = (this.archiveOperationTail ?? Promise.resolve()).then(t, t);
|
|
4322
4364
|
return this.archiveOperationTail = n.then(() => void 0, () => void 0), n;
|
|
@@ -4366,11 +4408,11 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4366
4408
|
for (let e of i.rows) for (let t of e.cells) o.set(`${t.row}:${t.col}`, t);
|
|
4367
4409
|
return ka(n, (e, t) => {
|
|
4368
4410
|
let n = o.get(`${e}:${t}`);
|
|
4369
|
-
return n ?
|
|
4411
|
+
return n ? Xt(n, a, null, i.date1904) : null;
|
|
4370
4412
|
});
|
|
4371
4413
|
}
|
|
4372
4414
|
cellText(e, t) {
|
|
4373
|
-
return this.parsedWorkbook ?
|
|
4415
|
+
return this.parsedWorkbook ? Xt(t, this.parsedWorkbook.styles, null, e.date1904) : "";
|
|
4374
4416
|
}
|
|
4375
4417
|
async renderViewport(e, t, n, r = {}) {
|
|
4376
4418
|
if (this.assertResourceHealthy(), this._mode === "worker") throw Error("renderViewport(canvas) is unavailable in mode: 'worker'; use renderViewportToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
@@ -4381,7 +4423,9 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4381
4423
|
return r !== t && Ci(t, r), a.layoutMetrics && or.forWorksheet(r, a.layoutMetrics.maximumDigitWidth), Sa({
|
|
4382
4424
|
ws: r,
|
|
4383
4425
|
styles: i,
|
|
4384
|
-
math: this.math
|
|
4426
|
+
math: this.math,
|
|
4427
|
+
threeD: this.threeD,
|
|
4428
|
+
regionMap: this.regionMap
|
|
4385
4429
|
}, e, n, {
|
|
4386
4430
|
...s,
|
|
4387
4431
|
fetchImage: this._fetchImage
|
|
@@ -4392,7 +4436,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4392
4436
|
this.assertResourceHealthy();
|
|
4393
4437
|
let r = Fa(n), i = {
|
|
4394
4438
|
...r.opts,
|
|
4395
|
-
dpr: n.dpr ??
|
|
4439
|
+
dpr: n.dpr ?? F()
|
|
4396
4440
|
};
|
|
4397
4441
|
if (this._mode === "worker") {
|
|
4398
4442
|
if (!Number.isInteger(e) || e < 0 || e >= this.sheetCount) throw Error(`Sheet index ${e} out of range (count: ${this.sheetCount})`);
|
|
@@ -4439,8 +4483,8 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4439
4483
|
}
|
|
4440
4484
|
destroy() {
|
|
4441
4485
|
this.generation = (this.generation ?? 1) + 1, this.worksheetPullClient?.cancelAll("closed").catch(() => void 0), this.worksheetPullClient = null, this.bridge.terminate(), this.parsedWorkbook = null, this.sheetCache.clear(), this.sheetLoads.clear(), this.fontsDestroyed = !0;
|
|
4442
|
-
for (let e of this.retainedFontSets.values()) e.faces &&
|
|
4443
|
-
this.retainedFontSets.clear(), this.googleFontNames = [],
|
|
4486
|
+
for (let e of this.retainedFontSets.values()) e.faces && Me(e.faces);
|
|
4487
|
+
this.retainedFontSets.clear(), this.googleFontNames = [], z(this._fetchImage), c(this._fetchImage), this.rawParts.clear(), this.queuedImageLoads?.clear();
|
|
4444
4488
|
}
|
|
4445
4489
|
assertResourceHealthy() {
|
|
4446
4490
|
if (this.resourceFailure) throw this.resourceFailure;
|
|
@@ -4473,10 +4517,10 @@ function Ba(e, t, n) {
|
|
|
4473
4517
|
//#endregion
|
|
4474
4518
|
//#region packages/xlsx/src/element-context.ts
|
|
4475
4519
|
function Va(e, t) {
|
|
4476
|
-
let n = t.colAxis.offsetOf(e.fromCol + 1) + e.fromColOff * t.scale /
|
|
4477
|
-
if (ur(e)) i = e.nativeExtCx * t.scale /
|
|
4520
|
+
let n = t.colAxis.offsetOf(e.fromCol + 1) + e.fromColOff * t.scale / J, r = t.rowAxis.offsetOf(e.fromRow + 1) + e.fromRowOff * t.scale / J, i, a;
|
|
4521
|
+
if (ur(e)) i = e.nativeExtCx * t.scale / J, a = e.nativeExtCy * t.scale / J;
|
|
4478
4522
|
else {
|
|
4479
|
-
let o = t.colAxis.offsetOf(e.toCol + 1) + e.toColOff * t.scale /
|
|
4523
|
+
let o = t.colAxis.offsetOf(e.toCol + 1) + e.toColOff * t.scale / J, s = t.rowAxis.offsetOf(e.toRow + 1) + e.toRowOff * t.scale / J;
|
|
4480
4524
|
i = o - n, a = s - r;
|
|
4481
4525
|
}
|
|
4482
4526
|
if (i <= 0 || a <= 0) return null;
|
|
@@ -4616,7 +4660,7 @@ function Za(e, t, n, r, i) {
|
|
|
4616
4660
|
for (let a = e.charts.length - 1; a >= 0; a--) {
|
|
4617
4661
|
let o = e.charts[a], s = Va(o, r);
|
|
4618
4662
|
if (!s || !Ua(s, r) || !Ha(n, s)) continue;
|
|
4619
|
-
let c =
|
|
4663
|
+
let c = q(o.chart, i);
|
|
4620
4664
|
return {
|
|
4621
4665
|
...Xa(e, t, "chart", a, o, c.text, c.truncated, c.maxTextCharacters),
|
|
4622
4666
|
seriesCount: o.chart.series.length
|
|
@@ -4669,16 +4713,16 @@ function eo(e, t, n, r, i) {
|
|
|
4669
4713
|
}
|
|
4670
4714
|
return null;
|
|
4671
4715
|
}
|
|
4672
|
-
function to(e, t, n, r, i =
|
|
4716
|
+
function to(e, t, n, r, i = De) {
|
|
4673
4717
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) throw RangeError("XLSX hit-test point must contain finite coordinates.");
|
|
4674
4718
|
if (!Number.isFinite(i) || i < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
4675
|
-
let a = Math.min(
|
|
4719
|
+
let a = Math.min(De, Math.floor(i)), o = Ga(e, r);
|
|
4676
4720
|
return Wa(n, o) ? Za(e, t, n, o, a) ?? $a(e, t, n, o, a) ?? eo(e, t, n, o, a) : null;
|
|
4677
4721
|
}
|
|
4678
4722
|
function no(e, t) {
|
|
4679
4723
|
let n = t ?? e.maxTextCharacters;
|
|
4680
4724
|
if (!Number.isFinite(n) || n < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
4681
|
-
let r = Math.min(
|
|
4725
|
+
let r = Math.min(De, Math.floor(n)), i = e.text === void 0 ? void 0 : Ja(e.text, r), a = e.truncated || e.text !== void 0 && i.length < e.text.length;
|
|
4682
4726
|
return {
|
|
4683
4727
|
...structuredClone(e),
|
|
4684
4728
|
...i === void 0 ? {} : { text: i },
|
|
@@ -4692,7 +4736,7 @@ function no(e, t) {
|
|
|
4692
4736
|
//#region packages/xlsx/src/selection.ts
|
|
4693
4737
|
var ro = 128, io = 1e4, ao = 8 * 1024 * 1024;
|
|
4694
4738
|
function oo(e) {
|
|
4695
|
-
return e.areas.reduce((e, t) => e + (t.kind === "cells" ? (t.bottom - t.top + 1) * (t.right - t.left + 1) : t.kind === "rows" ? (t.lastRow - t.firstRow + 1) *
|
|
4739
|
+
return e.areas.reduce((e, t) => e + (t.kind === "cells" ? (t.bottom - t.top + 1) * (t.right - t.left + 1) : t.kind === "rows" ? (t.lastRow - t.firstRow + 1) * Q : t.kind === "columns" ? (t.lastColumn - t.firstColumn + 1) * ar : ar * Q), 0);
|
|
4696
4740
|
}
|
|
4697
4741
|
function so(e, t) {
|
|
4698
4742
|
return Number.isInteger(e) && e >= 1 && e <= t;
|
|
@@ -4895,7 +4939,7 @@ var go = class {
|
|
|
4895
4939
|
if (n !== this._generation) return [];
|
|
4896
4940
|
let o = this._sheetName(a);
|
|
4897
4941
|
for (let n of r) {
|
|
4898
|
-
let r =
|
|
4942
|
+
let r = xe(we([{ text: n.text }]), e, t);
|
|
4899
4943
|
for (let e of r) {
|
|
4900
4944
|
let t = e.slices[0], r = n.text.slice(t.start, t.end);
|
|
4901
4945
|
i.push({
|
|
@@ -4911,10 +4955,10 @@ var go = class {
|
|
|
4911
4955
|
return n === this._generation ? (this._matches = i, this._active = -1, this.matches()) : [];
|
|
4912
4956
|
}
|
|
4913
4957
|
next() {
|
|
4914
|
-
return this._active =
|
|
4958
|
+
return this._active = be(this._active, this._matches.length), this._activePublic();
|
|
4915
4959
|
}
|
|
4916
4960
|
prev() {
|
|
4917
|
-
return this._active =
|
|
4961
|
+
return this._active = Te(this._active, this._matches.length), this._activePublic();
|
|
4918
4962
|
}
|
|
4919
4963
|
_activePublic() {
|
|
4920
4964
|
let e = this._locationAt(this._active);
|
|
@@ -5097,7 +5141,7 @@ function ko(e, t) {
|
|
|
5097
5141
|
//#endregion
|
|
5098
5142
|
//#region packages/xlsx/src/internal/sheet-viewer-runtime.ts
|
|
5099
5143
|
var Ao = class {
|
|
5100
|
-
owner = new
|
|
5144
|
+
owner = new ve("SheetAcquisition");
|
|
5101
5145
|
get current() {
|
|
5102
5146
|
return this.owner.current;
|
|
5103
5147
|
}
|
|
@@ -5179,7 +5223,7 @@ var Mo = class {
|
|
|
5179
5223
|
this.frameScheduler = typeof r.requestAnimationFrame == "function" && typeof r.cancelAnimationFrame == "function" ? {
|
|
5180
5224
|
requestAnimationFrame: (e) => r.requestAnimationFrame(e),
|
|
5181
5225
|
cancelAnimationFrame: (e) => r.cancelAnimationFrame(e)
|
|
5182
|
-
} : null, this.staticDispatcher = e ? new
|
|
5226
|
+
} : null, this.staticDispatcher = e ? new Se(e, t) : null;
|
|
5183
5227
|
}
|
|
5184
5228
|
begin() {
|
|
5185
5229
|
return this.staticDispatcher ? this.staticDispatcher.begin() : ++this.generation;
|
|
@@ -5493,14 +5537,37 @@ function Ro(e, t, n, r) {
|
|
|
5493
5537
|
};
|
|
5494
5538
|
}
|
|
5495
5539
|
//#endregion
|
|
5540
|
+
//#region packages/xlsx/src/internal/worksheet-content-bounds.ts
|
|
5541
|
+
function zo(e) {
|
|
5542
|
+
let t = Math.max(50, e.freezeRows ?? 0), n = Math.max(26, e.freezeCols ?? 0);
|
|
5543
|
+
for (let r of e.rows) {
|
|
5544
|
+
r.index > t && (t = r.index);
|
|
5545
|
+
for (let e of r.cells) e.col > n && (n = e.col);
|
|
5546
|
+
}
|
|
5547
|
+
let r = [
|
|
5548
|
+
...e.charts,
|
|
5549
|
+
...e.images,
|
|
5550
|
+
...e.shapeGroups ?? [],
|
|
5551
|
+
...e.slicers ?? []
|
|
5552
|
+
];
|
|
5553
|
+
for (let e of r) {
|
|
5554
|
+
let r = Number.isSafeInteger(e.fromRow) ? e.fromRow + 1 : 0, i = Number.isSafeInteger(e.toRow) ? e.toRow + 1 : 0, a = Number.isSafeInteger(e.fromCol) ? e.fromCol + 1 : 0, o = Number.isSafeInteger(e.toCol) ? e.toCol + 1 : 0;
|
|
5555
|
+
t = Math.max(t, r, i), n = Math.max(n, a, o);
|
|
5556
|
+
}
|
|
5557
|
+
return {
|
|
5558
|
+
maxRow: Math.min(ar, t),
|
|
5559
|
+
maxCol: Math.min(Q, n)
|
|
5560
|
+
};
|
|
5561
|
+
}
|
|
5562
|
+
//#endregion
|
|
5496
5563
|
//#region packages/xlsx/src/viewer.ts
|
|
5497
|
-
var
|
|
5498
|
-
function
|
|
5499
|
-
if (!e.head || e.head.querySelector(`style[${
|
|
5564
|
+
var Bo = Symbol("XlsxViewer.borrowedWorkbook"), Vo = 150, Ho = 280, Uo = 200, Wo = 240, Go = 200, Ko = 30, qo = 50, Jo = 1, Yo = 1, Xo = .45, Zo = "data-xlsx-viewer-styles", Qo = ".xlsx-tab-strip::-webkit-scrollbar{display:none}[data-xlsx-viewport-input]:focus{outline:none}.xlsx-tab-nav{background:transparent;transition:background 0.1s;}.xlsx-tab-nav:hover{background:rgba(0,0,0,0.08);}.xlsx-zoom-slider{-webkit-appearance:none;appearance:none;background:transparent;height:15px;margin:0;}.xlsx-zoom-slider::-webkit-slider-runnable-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:50%;background:#808080;cursor:pointer;}.xlsx-zoom-slider:hover::-webkit-slider-thumb{background:#5f5f5f;}.xlsx-zoom-slider::-moz-range-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-moz-range-thumb{width:12px;height:12px;border:none;border-radius:50%;background:#808080;cursor:pointer;}";
|
|
5565
|
+
function $o(e) {
|
|
5566
|
+
if (!e.head || e.head.querySelector(`style[${Zo}]`)) return;
|
|
5500
5567
|
let t = e.createElement("style");
|
|
5501
|
-
t.setAttribute(
|
|
5568
|
+
t.setAttribute(Zo, ""), t.textContent = Qo, e.head.appendChild(t);
|
|
5502
5569
|
}
|
|
5503
|
-
function
|
|
5570
|
+
function es(e) {
|
|
5504
5571
|
let t = [...e].sort((e, t) => e.first - t.first || e.last - t.last), n = [];
|
|
5505
5572
|
for (let e of t) {
|
|
5506
5573
|
let t = n.at(-1);
|
|
@@ -5511,7 +5578,7 @@ function $o(e) {
|
|
|
5511
5578
|
}
|
|
5512
5579
|
return n;
|
|
5513
5580
|
}
|
|
5514
|
-
function
|
|
5581
|
+
function ts(e, t) {
|
|
5515
5582
|
let n = 0, r = e.length - 1;
|
|
5516
5583
|
for (; n <= r;) {
|
|
5517
5584
|
let i = n + r >>> 1, a = e[i];
|
|
@@ -5521,7 +5588,7 @@ function es(e, t) {
|
|
|
5521
5588
|
}
|
|
5522
5589
|
return !1;
|
|
5523
5590
|
}
|
|
5524
|
-
function
|
|
5591
|
+
function ns(e, t, n) {
|
|
5525
5592
|
let r = 0, i = e.length;
|
|
5526
5593
|
for (; r < i;) {
|
|
5527
5594
|
let a = r + i >>> 1;
|
|
@@ -5529,12 +5596,12 @@ function ts(e, t, n) {
|
|
|
5529
5596
|
}
|
|
5530
5597
|
return r;
|
|
5531
5598
|
}
|
|
5532
|
-
function
|
|
5599
|
+
function rs(e, t) {
|
|
5533
5600
|
for (let n = 1; n < e.length; n++) if (t(e[n - 1]) > t(e[n])) return [...e].sort((e, n) => t(e) - t(n));
|
|
5534
5601
|
return e;
|
|
5535
5602
|
}
|
|
5536
|
-
var
|
|
5537
|
-
function
|
|
5603
|
+
var is = "#1a73e8", as = 4, os = 5, ss = 25e4, cs = 8 * 1024 * 1024, ls = 1 * 1024 * 1024, us = 65536, ds = 65536, fs = 100;
|
|
5604
|
+
function ps(e, t) {
|
|
5538
5605
|
let n = Math.min(e.length, Math.max(0, t));
|
|
5539
5606
|
if (n > 0 && n < e.length) {
|
|
5540
5607
|
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
@@ -5542,7 +5609,7 @@ function fs(e, t) {
|
|
|
5542
5609
|
}
|
|
5543
5610
|
return e.slice(0, n);
|
|
5544
5611
|
}
|
|
5545
|
-
function
|
|
5612
|
+
function ms(e, t) {
|
|
5546
5613
|
let n = 0, r = !1;
|
|
5547
5614
|
for (let t = 0; t < e.length; t++) {
|
|
5548
5615
|
let i = e.charCodeAt(t);
|
|
@@ -5550,17 +5617,17 @@ function ps(e, t) {
|
|
|
5550
5617
|
}
|
|
5551
5618
|
return e.length + (r ? n + 2 : 0) > t ? null : r ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
5552
5619
|
}
|
|
5553
|
-
function
|
|
5620
|
+
function hs(e, t, n, r) {
|
|
5554
5621
|
for (let { index: i, edge: a } of t) if (!(a <= r) && Math.abs(e - a) <= n) return i;
|
|
5555
5622
|
return null;
|
|
5556
5623
|
}
|
|
5557
|
-
function
|
|
5624
|
+
function gs(e) {
|
|
5558
5625
|
return {
|
|
5559
5626
|
border: `2px solid ${e}`,
|
|
5560
5627
|
background: `color-mix(in srgb, ${e} 8%, transparent)`
|
|
5561
5628
|
};
|
|
5562
5629
|
}
|
|
5563
|
-
function
|
|
5630
|
+
function _s(e) {
|
|
5564
5631
|
let t = [];
|
|
5565
5632
|
for (let n of e) {
|
|
5566
5633
|
let e = n.x + n.width, r = n.y + n.height;
|
|
@@ -5606,15 +5673,15 @@ function gs(e) {
|
|
|
5606
5673
|
}
|
|
5607
5674
|
return r.join("");
|
|
5608
5675
|
}
|
|
5609
|
-
var
|
|
5610
|
-
function
|
|
5611
|
-
let n = e ? "#fb8c00" : "#ffb300", r = e ? t.active : t.match, i = r ?? (e ?
|
|
5676
|
+
var vs = 0, ys = "color-mix(in srgb, #ffb300 8%, transparent)", bs = "color-mix(in srgb, #fb8c00 8%, transparent)";
|
|
5677
|
+
function xs(e, t = {}) {
|
|
5678
|
+
let n = e ? "#fb8c00" : "#ffb300", r = e ? t.active : t.match, i = r ?? (e ? bs : ys);
|
|
5612
5679
|
return {
|
|
5613
5680
|
border: `2px solid ${r ?? n}`,
|
|
5614
5681
|
background: i
|
|
5615
5682
|
};
|
|
5616
5683
|
}
|
|
5617
|
-
var
|
|
5684
|
+
var Ss = class {
|
|
5618
5685
|
hostDocument;
|
|
5619
5686
|
hostWindow;
|
|
5620
5687
|
acquisition = new Ao();
|
|
@@ -5637,7 +5704,7 @@ var xs = class {
|
|
|
5637
5704
|
stashedRowHeights = /* @__PURE__ */ new Map();
|
|
5638
5705
|
stashedColWidths = /* @__PURE__ */ new Map();
|
|
5639
5706
|
sizeOverrideStore = /* @__PURE__ */ new Map();
|
|
5640
|
-
projectionId =
|
|
5707
|
+
projectionId = Yo++;
|
|
5641
5708
|
canvasArea;
|
|
5642
5709
|
scrollHost;
|
|
5643
5710
|
spacer;
|
|
@@ -5724,18 +5791,18 @@ var xs = class {
|
|
|
5724
5791
|
let r = this.hostDocument.defaultView;
|
|
5725
5792
|
if (!r) throw Error("XlsxViewer requires a document with an active Window");
|
|
5726
5793
|
this.hostWindow = r, this.opts = t, this._mountKind = n.kind, this._nativeScrollbars = t.showScrollbars ?? !0;
|
|
5727
|
-
let i = t[
|
|
5728
|
-
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode :
|
|
5794
|
+
let i = t[Bo];
|
|
5795
|
+
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode : Ce("XlsxViewer", t.mode, i), this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.viewport = new Mo(t.cellScale ?? 1), this.wrapper = this.hostDocument.createElement("div"), this.wrapper.style.cssText = `position:relative;width:100%;height:100%;background:${n.kind === "composite" ? "#fff" : "transparent"};box-sizing:border-box;font-family:sans-serif;display:flex;flex-direction:column;`, this.gridRegion = this.hostDocument.createElement("div"), this.gridRegion.style.cssText = "position:relative;flex:1;min-height:0;overflow:hidden;";
|
|
5729
5796
|
let a = "position:absolute;top:0;left:0;z-index:3;display:none;background:#f5f5f5;";
|
|
5730
5797
|
if (this.cornerGutter = this.hostDocument.createElement("canvas"), this.cornerGutter.style.cssText = a, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = this.hostDocument.createElement("canvas"), this.colGutter.style.cssText = a, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = this.hostDocument.createElement("canvas"), this.rowGutter.style.cssText = a, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = this.hostDocument.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = n.kind === "sheet" ? n.canvas : this.hostDocument.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this.renderDispatcher = new No(this.canvas, this._mode === "worker", this.hostWindow), this.scrollHost = this.hostDocument.createElement("div"), this.scrollHost.setAttribute("data-xlsx-viewport-input", n.kind), this.scrollHost.tabIndex = 0, this.scrollHost.style.cssText = `position:absolute;inset:0;overflow:${this._nativeScrollbars ? "auto" : "clip"};z-index:2;background:transparent;`, this.spacer = this.hostDocument.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this._nativeScrollbars && this.scrollHost.appendChild(this.spacer), this.surface = new Fo(this.canvas, this.canvasArea, this.scrollHost), this.overlayHost = new Io(this.canvasArea, this.canvas, this.scrollHost, {
|
|
5731
|
-
commentMaxWidth:
|
|
5732
|
-
commentMaxHeight:
|
|
5733
|
-
validationMaxWidth:
|
|
5734
|
-
validationMaxHeight:
|
|
5735
|
-
}), this.selectionOverlay = this.overlayHost.selection, this.findOverlay = this.overlayHost.find, this.commentPopup = this.overlayHost.comment, this.validationPanel = this.overlayHost.validation,
|
|
5736
|
-
this.tabBar = this.hostDocument.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${
|
|
5798
|
+
commentMaxWidth: Ho,
|
|
5799
|
+
commentMaxHeight: Uo,
|
|
5800
|
+
validationMaxWidth: Wo,
|
|
5801
|
+
validationMaxHeight: Go
|
|
5802
|
+
}), this.selectionOverlay = this.overlayHost.selection, this.findOverlay = this.overlayHost.find, this.commentPopup = this.overlayHost.comment, this.validationPanel = this.overlayHost.validation, $o(this.hostDocument), n.kind === "composite") {
|
|
5803
|
+
this.tabBar = this.hostDocument.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${Ko}px;flex-shrink:0;background:#f0f0f0;border-top:1px solid #c8ccd0;`, this.navPrev = this.makeNavButton("◀", "Scroll tabs left", () => this.scrollTabs(-1)), this.navNext = this.makeNavButton("▶", "Scroll tabs right", () => this.scrollTabs(1)), this.navPrev.dataset.xlsxTabNav = "prev", this.navNext.dataset.xlsxTabNav = "next";
|
|
5737
5804
|
let e = this.hostDocument.createElement("div");
|
|
5738
|
-
e.style.cssText = `display:flex;flex-shrink:0;width:${
|
|
5805
|
+
e.style.cssText = `display:flex;flex-shrink:0;width:${qo}px;height:100%;`, e.appendChild(this.navPrev), e.appendChild(this.navNext), this.tabStrip = this.hostDocument.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:block;flex:1;min-width:0;height:100%;margin-left:${Jo}px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;`, this.tabStrip.classList.add("xlsx-tab-strip"), this.tabStrip.addEventListener("scroll", () => this.updateNavButtons()), this.tabList = this.hostDocument.createElement("div"), this.tabList.style.cssText = `display:flex;align-items:flex-end;height:100%;gap:${Jo}px;box-sizing:border-box;`, this.tabList.style.width = "max-content", this.tabList.style.minWidth = "100%", this.tabStrip.appendChild(this.tabList), this.tabBar.appendChild(e), this.tabBar.appendChild(this.tabStrip), this.opts.showZoomSlider !== !1 && this.tabBar.appendChild(this.buildZoomControl());
|
|
5739
5806
|
}
|
|
5740
5807
|
this.gridRegion.appendChild(this.canvasArea), this.wrapper.appendChild(this.gridRegion), n.kind === "composite" && this.wrapper.appendChild(this.tabBar), e.appendChild(this.wrapper), this.rowGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "row")), this.colGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "col")), this._nativeScrollbars && this.surface.on("scroll", () => {
|
|
5741
5808
|
if (this.pendingTap = null, this.pendingElementClick = null, this.hideCommentPopup(), this.hideValidationPanel(), this.scrollHost.clientWidth > 0) {
|
|
@@ -5780,6 +5847,8 @@ var xs = class {
|
|
|
5780
5847
|
workerTimeoutMs: this.opts.workerTimeoutMs,
|
|
5781
5848
|
wasmUrl: this.opts.wasmUrl,
|
|
5782
5849
|
math: this.opts.math,
|
|
5850
|
+
threeD: this.opts.threeD,
|
|
5851
|
+
regionMap: this.opts.regionMap,
|
|
5783
5852
|
mode: this._mode
|
|
5784
5853
|
}), () => {
|
|
5785
5854
|
this.sheetRequestGeneration++, this.renderDispatcher.begin(), this._find.invalidate(), this.hideValidationPanel(), this.releaseHostFonts();
|
|
@@ -6047,7 +6116,7 @@ var xs = class {
|
|
|
6047
6116
|
return this.currentWorksheet?.rightToLeft === !0;
|
|
6048
6117
|
}
|
|
6049
6118
|
updateFooterDirection() {
|
|
6050
|
-
this._mountKind === "composite" && (this.tabBar.style.flexDirection = this.isRtl ? "row-reverse" : "row", this.tabStrip.style.marginLeft = this.isRtl ? "0" : `${
|
|
6119
|
+
this._mountKind === "composite" && (this.tabBar.style.flexDirection = this.isRtl ? "row-reverse" : "row", this.tabStrip.style.marginLeft = this.isRtl ? "0" : `${Jo}px`, this.tabStrip.style.marginRight = this.isRtl ? `${Jo}px` : "0", this.tabList.style.flexDirection = this.isRtl ? "row-reverse" : "row");
|
|
6051
6120
|
}
|
|
6052
6121
|
get maxScrollLeft() {
|
|
6053
6122
|
return this.syncNativeViewportExtent(), this.viewport.maxX;
|
|
@@ -6128,10 +6197,10 @@ var xs = class {
|
|
|
6128
6197
|
!n || !this.currentWorksheet || (this._scrollCellIntoView(n.row, n.col, t.align ?? "nearest"), await this.renderCurrentSheet(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.emitViewportChange());
|
|
6129
6198
|
}
|
|
6130
6199
|
_stepSheet(e) {
|
|
6131
|
-
return this._hiddenSheetMode === "skip" && this.wb ?
|
|
6200
|
+
return this._hiddenSheetMode === "skip" && this.wb ? Ue(this.currentSheet, e, (e) => this.wb.isHidden(e), this.sheetCount) : this.currentSheet + e;
|
|
6132
6201
|
}
|
|
6133
6202
|
_initialSheet() {
|
|
6134
|
-
return this._hiddenSheetMode === "skip" && this.wb ?
|
|
6203
|
+
return this._hiddenSheetMode === "skip" && this.wb ? We(0, (e) => this.wb.isHidden(e), this.sheetCount) : 0;
|
|
6135
6204
|
}
|
|
6136
6205
|
getCellAt(e, t) {
|
|
6137
6206
|
if (this._destroyed) return null;
|
|
@@ -6211,22 +6280,22 @@ var xs = class {
|
|
|
6211
6280
|
if (!t || !n) return null;
|
|
6212
6281
|
let r = e.maxCells ?? 1e3;
|
|
6213
6282
|
if (!Number.isFinite(r) || r < 0) throw RangeError("maxCells must be a finite non-negative number.");
|
|
6214
|
-
let i = Math.min(io, Math.floor(r)), a = e.maxTextCharacters ??
|
|
6283
|
+
let i = Math.min(io, Math.floor(r)), a = e.maxTextCharacters ?? ls;
|
|
6215
6284
|
if (!Number.isFinite(a) || a < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
6216
6285
|
let o = Math.min(ao, Math.floor(a)), s = 0, c = !1, l = (e) => {
|
|
6217
6286
|
let t = typeof e == "string" ? [e] : e, n = [], r = 0;
|
|
6218
6287
|
for (let e = 0; e < t.length; e++) {
|
|
6219
|
-
let i = t[e], a = typeof i == "string" ? i : i.text, l = Math.max(0, Math.min(
|
|
6288
|
+
let i = t[e], a = typeof i == "string" ? i : i.text, l = Math.max(0, Math.min(ds - r, o - s)), u = ps(a, l);
|
|
6220
6289
|
if (n.push(u), r += u.length, s += u.length, u.length < a.length || e + 1 < t.length && l === 0) {
|
|
6221
6290
|
c = !0;
|
|
6222
6291
|
break;
|
|
6223
6292
|
}
|
|
6224
6293
|
}
|
|
6225
6294
|
return n.join("");
|
|
6226
|
-
}, u = n.areas.some((e) => e.kind === "sheet"), d =
|
|
6295
|
+
}, u = n.areas.some((e) => e.kind === "sheet"), d = es(n.areas.flatMap((e) => e.kind === "rows" ? [{
|
|
6227
6296
|
first: e.firstRow,
|
|
6228
6297
|
last: e.lastRow
|
|
6229
|
-
}] : [])), f =
|
|
6298
|
+
}] : [])), f = es(n.areas.flatMap((e) => e.kind === "columns" ? [{
|
|
6230
6299
|
first: e.firstColumn,
|
|
6231
6300
|
last: e.lastColumn
|
|
6232
6301
|
}] : [])), p = n.areas.flatMap((e) => e.kind === "cells" ? [e] : []), m = p.flatMap((e, t) => [{
|
|
@@ -6239,14 +6308,14 @@ var xs = class {
|
|
|
6239
6308
|
active: !1
|
|
6240
6309
|
}]).sort((e, t) => e.row - t.row || Number(e.active) - Number(t.active)), h = /* @__PURE__ */ new Set(), g = 0, _ = [], v = [], y = !1, b = u || f.length > 0 ? [{
|
|
6241
6310
|
first: 1,
|
|
6242
|
-
last:
|
|
6243
|
-
}] :
|
|
6311
|
+
last: ar
|
|
6312
|
+
}] : es([...d, ...p.map((e) => ({
|
|
6244
6313
|
first: e.top,
|
|
6245
6314
|
last: e.bottom
|
|
6246
6315
|
}))]), x = this.selectionContextRows.get(t);
|
|
6247
|
-
x || (x =
|
|
6316
|
+
x || (x = rs(t.rows, (e) => e.index), this.selectionContextRows.set(t, x));
|
|
6248
6317
|
cellScan: for (let e of b) {
|
|
6249
|
-
let n =
|
|
6318
|
+
let n = ns(x, e.first, (e) => e.index);
|
|
6250
6319
|
for (; n < x.length;) {
|
|
6251
6320
|
let r = x[n++];
|
|
6252
6321
|
if (r.index > e.last) break;
|
|
@@ -6255,18 +6324,18 @@ var xs = class {
|
|
|
6255
6324
|
let e = m[g++];
|
|
6256
6325
|
e.active ? h.add(e.index) : h.delete(e.index), a = !0;
|
|
6257
6326
|
}
|
|
6258
|
-
a && (_ =
|
|
6327
|
+
a && (_ = es([...h].map((e) => ({
|
|
6259
6328
|
first: p[e].left,
|
|
6260
6329
|
last: p[e].right
|
|
6261
6330
|
}))));
|
|
6262
|
-
let o = u ||
|
|
6331
|
+
let o = u || ts(d, r.index) ? [{
|
|
6263
6332
|
first: 1,
|
|
6264
|
-
last:
|
|
6265
|
-
}] :
|
|
6333
|
+
last: Q
|
|
6334
|
+
}] : es([...f, ..._]);
|
|
6266
6335
|
for (let e of o) {
|
|
6267
6336
|
let n = this.selectionContextCells.get(r);
|
|
6268
|
-
n || (n =
|
|
6269
|
-
let a =
|
|
6337
|
+
n || (n = rs(r.cells, (e) => e.col), this.selectionContextCells.set(r, n));
|
|
6338
|
+
let a = ns(n, e.first, (e) => e.col);
|
|
6270
6339
|
for (; a < n.length;) {
|
|
6271
6340
|
let r = n[a++];
|
|
6272
6341
|
if (r.col > e.last) break;
|
|
@@ -6319,7 +6388,7 @@ var xs = class {
|
|
|
6319
6388
|
if (!this.opts.onSelectionContextChange || this._destroyed || this.selectionContextNotificationFrame !== null || this.selectionContextNotificationMicrotask) return;
|
|
6320
6389
|
let e = () => {
|
|
6321
6390
|
if (this.selectionContextNotificationFrame = null, this.selectionContextNotificationMicrotask = !1, this._destroyed) return;
|
|
6322
|
-
let e = this.getSelectionContext({ maxTextCharacters:
|
|
6391
|
+
let e = this.getSelectionContext({ maxTextCharacters: us });
|
|
6323
6392
|
this.opts.onSelectionContextChange?.(e ? structuredClone(e) : null);
|
|
6324
6393
|
};
|
|
6325
6394
|
typeof this.hostWindow.requestAnimationFrame == "function" ? this.selectionContextNotificationFrame = this.hostWindow.requestAnimationFrame(e) : (this.selectionContextNotificationMicrotask = !0, queueMicrotask(e));
|
|
@@ -6334,7 +6403,7 @@ var xs = class {
|
|
|
6334
6403
|
this.finishSelectionNotificationChain();
|
|
6335
6404
|
return;
|
|
6336
6405
|
}
|
|
6337
|
-
if (this.selectionNotificationCount >=
|
|
6406
|
+
if (this.selectionNotificationCount >= fs) {
|
|
6338
6407
|
this.lastNotifiedSelectionState = e ? structuredClone(e) : null, this.finishSelectionNotificationChain();
|
|
6339
6408
|
return;
|
|
6340
6409
|
}
|
|
@@ -6393,7 +6462,7 @@ var xs = class {
|
|
|
6393
6462
|
edge: t.x + t.w
|
|
6394
6463
|
}));
|
|
6395
6464
|
}
|
|
6396
|
-
let o =
|
|
6465
|
+
let o = hs(a, i, as, s);
|
|
6397
6466
|
return o === null ? null : {
|
|
6398
6467
|
kind: "col",
|
|
6399
6468
|
index: o,
|
|
@@ -6413,7 +6482,7 @@ var xs = class {
|
|
|
6413
6482
|
edge: t.y + t.h
|
|
6414
6483
|
}));
|
|
6415
6484
|
}
|
|
6416
|
-
let a =
|
|
6485
|
+
let a = hs(o, i, as, c);
|
|
6417
6486
|
return a === null ? null : {
|
|
6418
6487
|
kind: "row",
|
|
6419
6488
|
index: a,
|
|
@@ -6428,11 +6497,11 @@ var xs = class {
|
|
|
6428
6497
|
if (!n || !r) return;
|
|
6429
6498
|
let i = this.viewport.scale, a = this.canvasArea.getBoundingClientRect();
|
|
6430
6499
|
if (n.kind === "col") {
|
|
6431
|
-
let t = this.screenX(e - a.left, 0), o = Math.max(
|
|
6432
|
-
r.colWidths[n.index] =
|
|
6500
|
+
let t = this.screenX(e - a.left, 0), o = Math.max(os, Math.round((t - n.originScaled) / i));
|
|
6501
|
+
r.colWidths[n.index] = tr(o, n.mdw), this.recordSizeOverride("col", n.index);
|
|
6433
6502
|
} else {
|
|
6434
|
-
let e = t - a.top, o = Math.max(
|
|
6435
|
-
r.rowHeights[n.index] =
|
|
6503
|
+
let e = t - a.top, o = Math.max(os, Math.round((e - n.originScaled) / i));
|
|
6504
|
+
r.rowHeights[n.index] = rr(o), this.recordSizeOverride("row", n.index);
|
|
6436
6505
|
}
|
|
6437
6506
|
or.invalidate(r), this.updateSpacerSize(r), this.updateSelectionOverlay(), this.scheduleRender();
|
|
6438
6507
|
}
|
|
@@ -6440,7 +6509,7 @@ var xs = class {
|
|
|
6440
6509
|
this.opts.selectionColor = e, this.updateSelectionOverlay();
|
|
6441
6510
|
}
|
|
6442
6511
|
async setHiddenSheetMode(e) {
|
|
6443
|
-
this._hiddenSheetMode = e, this.buildTabs(), e === "skip" && this.wb && this.wb.isHidden(this.currentSheet) ? await this.showSheet(
|
|
6512
|
+
this._hiddenSheetMode = e, this.buildTabs(), e === "skip" && this.wb && this.wb.isHidden(this.currentSheet) ? await this.showSheet(We(this.currentSheet, (e) => this.wb.isHidden(e), this.sheetCount)) : this.updateTabActive(this.currentSheet);
|
|
6444
6513
|
}
|
|
6445
6514
|
get hiddenSheetMode() {
|
|
6446
6515
|
return this._hiddenSheetMode;
|
|
@@ -6448,7 +6517,7 @@ var xs = class {
|
|
|
6448
6517
|
get visibleSheetCount() {
|
|
6449
6518
|
if (!this.wb) return 0;
|
|
6450
6519
|
let e = this.wb;
|
|
6451
|
-
return
|
|
6520
|
+
return Ge((t) => e.isHidden(t), this.sheetCount);
|
|
6452
6521
|
}
|
|
6453
6522
|
async copySelection() {
|
|
6454
6523
|
this.assertOpen();
|
|
@@ -6481,12 +6550,12 @@ var xs = class {
|
|
|
6481
6550
|
c1: n.left,
|
|
6482
6551
|
c2: n.right
|
|
6483
6552
|
}, l = o - a + 1, u = c - s + 1;
|
|
6484
|
-
if (l > Math.floor(
|
|
6553
|
+
if (l > Math.floor(ss / u)) return {
|
|
6485
6554
|
status: "too-large",
|
|
6486
6555
|
limit: "cells"
|
|
6487
6556
|
};
|
|
6488
6557
|
let d = l * u, f = Math.max(0, l - 1) + l * Math.max(0, u - 1);
|
|
6489
|
-
if (f >
|
|
6558
|
+
if (f > cs) return {
|
|
6490
6559
|
status: "too-large",
|
|
6491
6560
|
limit: "text"
|
|
6492
6561
|
};
|
|
@@ -6495,7 +6564,7 @@ var xs = class {
|
|
|
6495
6564
|
if (n.col < s || n.col > c) continue;
|
|
6496
6565
|
let r = n.value, i = this.wb?.cellText(e, n) ?? "";
|
|
6497
6566
|
if (this.wb || (r.type === "text" ? i = r.runs ? r.runs.map((e) => e.text).join("") : r.text : r.type === "number" ? i = String(r.number) : r.type === "bool" ? i = r.bool ? "TRUE" : "FALSE" : r.type === "error" && (i = r.error)), i) {
|
|
6498
|
-
let e =
|
|
6567
|
+
let e = ms(i, cs - f);
|
|
6499
6568
|
if (e === null) return {
|
|
6500
6569
|
status: "too-large",
|
|
6501
6570
|
limit: "text"
|
|
@@ -6550,12 +6619,12 @@ var xs = class {
|
|
|
6550
6619
|
end: Math.min(o, i + d)
|
|
6551
6620
|
}, {
|
|
6552
6621
|
first: l.cols + 1,
|
|
6553
|
-
last:
|
|
6622
|
+
last: Q,
|
|
6554
6623
|
start: Math.min(o, i + d),
|
|
6555
6624
|
end: o
|
|
6556
6625
|
}] : [{
|
|
6557
6626
|
first: 1,
|
|
6558
|
-
last:
|
|
6627
|
+
last: Q,
|
|
6559
6628
|
start: i,
|
|
6560
6629
|
end: o
|
|
6561
6630
|
}], m = l.rows > 0 ? [{
|
|
@@ -6565,15 +6634,15 @@ var xs = class {
|
|
|
6565
6634
|
end: Math.min(s, a + f)
|
|
6566
6635
|
}, {
|
|
6567
6636
|
first: l.rows + 1,
|
|
6568
|
-
last:
|
|
6637
|
+
last: ar,
|
|
6569
6638
|
start: Math.min(s, a + f),
|
|
6570
6639
|
end: s
|
|
6571
6640
|
}] : [{
|
|
6572
6641
|
first: 1,
|
|
6573
|
-
last:
|
|
6642
|
+
last: ar,
|
|
6574
6643
|
start: a,
|
|
6575
6644
|
end: s
|
|
6576
|
-
}], h = this.opts.selectionColor ??
|
|
6645
|
+
}], h = this.opts.selectionColor ?? is, { background: g } = gs(h), _ = /* @__PURE__ */ new Set(), v = [], y = [];
|
|
6577
6646
|
for (let t of e.areas) {
|
|
6578
6647
|
let e = t.kind === "cells" ? {
|
|
6579
6648
|
top: t.top,
|
|
@@ -6588,14 +6657,14 @@ var xs = class {
|
|
|
6588
6657
|
top: t.firstRow,
|
|
6589
6658
|
bottom: t.lastRow,
|
|
6590
6659
|
left: 1,
|
|
6591
|
-
right:
|
|
6660
|
+
right: Q,
|
|
6592
6661
|
topEdge: !0,
|
|
6593
6662
|
bottomEdge: !0,
|
|
6594
6663
|
leftEdge: !1,
|
|
6595
6664
|
rightEdge: !1
|
|
6596
6665
|
} : t.kind === "columns" ? {
|
|
6597
6666
|
top: 1,
|
|
6598
|
-
bottom:
|
|
6667
|
+
bottom: ar,
|
|
6599
6668
|
left: t.firstColumn,
|
|
6600
6669
|
right: t.lastColumn,
|
|
6601
6670
|
topEdge: !1,
|
|
@@ -6604,9 +6673,9 @@ var xs = class {
|
|
|
6604
6673
|
rightEdge: !0
|
|
6605
6674
|
} : {
|
|
6606
6675
|
top: 1,
|
|
6607
|
-
bottom:
|
|
6676
|
+
bottom: ar,
|
|
6608
6677
|
left: 1,
|
|
6609
|
-
right:
|
|
6678
|
+
right: Q,
|
|
6610
6679
|
topEdge: !1,
|
|
6611
6680
|
bottomEdge: !1,
|
|
6612
6681
|
leftEdge: !1,
|
|
@@ -6645,7 +6714,7 @@ var xs = class {
|
|
|
6645
6714
|
if (v.length > 0) {
|
|
6646
6715
|
let t = "http://www.w3.org/2000/svg", n = this.hostDocument.createElementNS(t, "svg");
|
|
6647
6716
|
n.setAttribute("data-xlsx-selection-fill", ""), n.style.cssText = "position:absolute;inset:0;width:100%;height:100%;overflow:hidden;pointer-events:none;";
|
|
6648
|
-
let r = e.areas.length > 1, i = this.getCellRect(e.activeCell.row, e.activeCell.col), a = `xlsx-selection-mask-${++
|
|
6717
|
+
let r = e.areas.length > 1, i = this.getCellRect(e.activeCell.row, e.activeCell.col), a = `xlsx-selection-mask-${++vs}`, c = this.hostDocument.createElementNS(t, "defs"), l = this.hostDocument.createElementNS(t, "mask");
|
|
6649
6718
|
l.setAttribute("id", a), l.setAttribute("maskUnits", "userSpaceOnUse"), l.setAttribute("x", "0"), l.setAttribute("y", "0"), l.setAttribute("width", String(o)), l.setAttribute("height", String(s));
|
|
6650
6719
|
let u = this.hostDocument.createElementNS(t, "path");
|
|
6651
6720
|
if (u.setAttribute("d", v.join("")), u.setAttribute("fill", "#fff"), l.appendChild(u), i) for (let e of m) for (let n of p) {
|
|
@@ -6657,7 +6726,7 @@ var xs = class {
|
|
|
6657
6726
|
c.appendChild(l), n.appendChild(c);
|
|
6658
6727
|
let d = this.hostDocument.createElementNS(t, "rect");
|
|
6659
6728
|
d.setAttribute("x", "0"), d.setAttribute("y", "0"), d.setAttribute("width", String(o)), d.setAttribute("height", String(s)), d.setAttribute("fill", g), d.setAttribute("mask", `url(#${a})`), n.appendChild(d);
|
|
6660
|
-
let f = r ? "" :
|
|
6729
|
+
let f = r ? "" : _s(y);
|
|
6661
6730
|
if (f) {
|
|
6662
6731
|
let e = this.hostDocument.createElementNS(t, "path");
|
|
6663
6732
|
e.setAttribute("data-xlsx-selection-border", ""), e.setAttribute("d", f), e.setAttribute("fill", "none"), e.setAttribute("stroke", h), e.setAttribute("stroke-width", "2"), e.setAttribute("stroke-linecap", "square"), e.setAttribute("stroke-linejoin", "miter"), n.appendChild(e);
|
|
@@ -6681,7 +6750,7 @@ var xs = class {
|
|
|
6681
6750
|
i.setAttribute("data-xlsx-element-context-clip", ""), i.style.cssText = `position:absolute;left:${r.clip.x}px;top:${r.clip.y}px;width:${r.clip.width}px;height:${r.clip.height}px;overflow:hidden;pointer-events:none;`;
|
|
6682
6751
|
let a = this.hostDocument.createElement("div");
|
|
6683
6752
|
a.setAttribute("data-xlsx-element-context-outline", e.elementType);
|
|
6684
|
-
let o = this.opts.selectionColor ??
|
|
6753
|
+
let o = this.opts.selectionColor ?? is;
|
|
6685
6754
|
a.style.cssText = `position:absolute;left:${r.rect.x - r.clip.x}px;top:${r.rect.y - r.clip.y}px;width:${r.rect.width}px;height:${r.rect.height}px;box-sizing:border-box;border:2px solid ${o};background:color-mix(in srgb, ${o} 6%, transparent);transform:rotate(${r.rotation}deg);transform-origin:center;pointer-events:none;`, i.appendChild(a), this.overlayHost.appendSelection(i);
|
|
6686
6755
|
}
|
|
6687
6756
|
maybeDrawValidationDropdown() {
|
|
@@ -6706,7 +6775,7 @@ var xs = class {
|
|
|
6706
6775
|
this.overlayHost.clearFind();
|
|
6707
6776
|
let e = this.currentWorksheet;
|
|
6708
6777
|
if (!e) return;
|
|
6709
|
-
let t = this.viewport.scale, n = (e) => Math.round(e * t), r = n(50), i = n(22), a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s = $(e).roundedFrozenExtent(t), c = r + s.width, l = i + s.height, u =
|
|
6778
|
+
let t = this.viewport.scale, n = (e) => Math.round(e * t), r = n(50), i = n(22), a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s = $(e).roundedFrozenExtent(t), c = r + s.width, l = i + s.height, u = xs(!1, this.opts.findHighlightColors), d = xs(!0, this.opts.findHighlightColors);
|
|
6710
6779
|
for (let e of this._find.sheetHighlights(this.currentSheet)) {
|
|
6711
6780
|
let t = this.getCellRect(e.row, e.col);
|
|
6712
6781
|
if (!t) continue;
|
|
@@ -6861,7 +6930,7 @@ var xs = class {
|
|
|
6861
6930
|
};
|
|
6862
6931
|
else return !1;
|
|
6863
6932
|
let r = this.opts.onHyperlinkClick;
|
|
6864
|
-
return r ? (r(n), !0) : (n.kind === "external" ?
|
|
6933
|
+
return r ? (r(n), !0) : (n.kind === "external" ? O(n.url, void 0, this.hostWindow) : this.navigateInternalHyperlink(n.ref), !0);
|
|
6865
6934
|
}
|
|
6866
6935
|
navigateInternalHyperlink(e) {
|
|
6867
6936
|
let t = e.lastIndexOf("!");
|
|
@@ -6879,7 +6948,7 @@ var xs = class {
|
|
|
6879
6948
|
}
|
|
6880
6949
|
this.commentPopupKey !== t && (this.hideCommentPopup(), this.commentPopupKey = t, this.commentPopupTimer = setTimeout(() => {
|
|
6881
6950
|
this.commentPopupTimer = null, this.renderCommentPopup(e, n);
|
|
6882
|
-
},
|
|
6951
|
+
}, Vo));
|
|
6883
6952
|
}
|
|
6884
6953
|
renderCommentPopup(e, t) {
|
|
6885
6954
|
let n = this.getCellRect(e.row, e.col);
|
|
@@ -7189,7 +7258,7 @@ var xs = class {
|
|
|
7189
7258
|
this._pendingZoomAnchor = Number.isFinite(t) && Number.isFinite(n) ? {
|
|
7190
7259
|
x: t,
|
|
7191
7260
|
y: n
|
|
7192
|
-
} : null, this.setScale(
|
|
7261
|
+
} : null, this.setScale(Ae(this.viewport.scale, e.deltaY));
|
|
7193
7262
|
}, { passive: !1 }), this.surface.on("pointerleave", () => this.hideCommentPopup()), this.keydownHandler = (e) => {
|
|
7194
7263
|
if ((e.ctrlKey || e.metaKey) && e.key === "c") {
|
|
7195
7264
|
if (e.defaultPrevented || e.isComposing) return;
|
|
@@ -7250,12 +7319,12 @@ var xs = class {
|
|
|
7250
7319
|
this.updateNavButtons();
|
|
7251
7320
|
}
|
|
7252
7321
|
tabStyle(e, t) {
|
|
7253
|
-
let n =
|
|
7322
|
+
let n = Ko - 2, r = Ko - 5, i = t ? `box-shadow:inset 0 -${e ? 2 : 3}px 0 0 ${t};` : "";
|
|
7254
7323
|
return e ? `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${n}px;font-size:13px;background:#fff;color:#000;border-bottom:1px solid #fff;font-weight:600;top:1px;` + i : `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${r}px;font-size:11px;background:#e0e0e0;color:#555;` + i;
|
|
7255
7324
|
}
|
|
7256
7325
|
tabCss(e, t) {
|
|
7257
7326
|
let n = this.tabStyle(t, this.tabColors[e]);
|
|
7258
|
-
return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${
|
|
7327
|
+
return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${Xo};`), n;
|
|
7259
7328
|
}
|
|
7260
7329
|
buildZoomControl() {
|
|
7261
7330
|
let e = this.opts.zoomMin ?? .1, t = this.opts.zoomMax ?? 4, n = this.viewport.scale, r = this.hostDocument.createElement("div");
|
|
@@ -7281,8 +7350,8 @@ var xs = class {
|
|
|
7281
7350
|
if (this.viewport.setScale(i), this.zoomSlider && (this.zoomSlider.value = String(this.zoomScaleToPos(i, t, n))), this.zoomLabel && (this.zoomLabel.textContent = `${r}%`), this.currentWorksheet) {
|
|
7282
7351
|
let e = this.effectiveScrollLeft, t = this.viewportTop;
|
|
7283
7352
|
if (this.layoutGutters(), this.updateSpacerSize(this.currentWorksheet), o) {
|
|
7284
|
-
this.viewportTop =
|
|
7285
|
-
let n = this.screenX(o.x, 0), r = this.maxScrollLeft, s =
|
|
7353
|
+
this.viewportTop = ye(t, o.y, a, i, { maxScroll: this.maxScrollTop });
|
|
7354
|
+
let n = this.screenX(o.x, 0), r = this.maxScrollLeft, s = ye(e, n, a, i, { maxScroll: r });
|
|
7286
7355
|
this.setViewportLeft(s);
|
|
7287
7356
|
} else this.setViewportLeft(e);
|
|
7288
7357
|
}
|
|
@@ -7293,10 +7362,10 @@ var xs = class {
|
|
|
7293
7362
|
return this.viewport.scale;
|
|
7294
7363
|
}
|
|
7295
7364
|
zoomIn() {
|
|
7296
|
-
this.setScale(
|
|
7365
|
+
this.setScale(Oe(this.getScale()));
|
|
7297
7366
|
}
|
|
7298
7367
|
zoomOut() {
|
|
7299
|
-
this.setScale(
|
|
7368
|
+
this.setScale(je(this.getScale()));
|
|
7300
7369
|
}
|
|
7301
7370
|
fitWidth() {
|
|
7302
7371
|
this._fit("width");
|
|
@@ -7307,7 +7376,7 @@ var xs = class {
|
|
|
7307
7376
|
_fit(e) {
|
|
7308
7377
|
let t = this.currentWorksheet;
|
|
7309
7378
|
if (!t) return;
|
|
7310
|
-
let { width: n, height: r } = this._naturalContentExtent(t), i =
|
|
7379
|
+
let { width: n, height: r } = this._naturalContentExtent(t), i = _e({
|
|
7311
7380
|
contentWidth: n,
|
|
7312
7381
|
contentHeight: r,
|
|
7313
7382
|
containerWidth: this.canvasArea.clientWidth,
|
|
@@ -7316,22 +7385,16 @@ var xs = class {
|
|
|
7316
7385
|
i <= 0 || this.setScale(i);
|
|
7317
7386
|
}
|
|
7318
7387
|
_naturalContentExtent(e) {
|
|
7319
|
-
let
|
|
7320
|
-
for (let r of e.rows) {
|
|
7321
|
-
r.index > t && (t = r.index);
|
|
7322
|
-
for (let e of r.cells) e.col > n && (n = e.col);
|
|
7323
|
-
}
|
|
7388
|
+
let { maxRow: t, maxCol: n } = zo(e);
|
|
7324
7389
|
return $(e).logicalContentExtent(t, n, 50, 22);
|
|
7325
7390
|
}
|
|
7326
7391
|
updateSpacerSize(e) {
|
|
7327
|
-
let t = this.viewport.scale
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
let o = $(e).roundedContentExtent(i, a, t, 50, 22), s = o.width, c = o.height;
|
|
7334
|
-
this.spacer.style.width = `${s}px`, this.spacer.style.height = `${c}px`, this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.viewport.setExtent(s, c), this.setViewportLeft(this.viewport.x), this.viewportTop = this.viewport.y;
|
|
7392
|
+
let t = this.viewport.scale;
|
|
7393
|
+
e.freezeRows, e.freezeCols;
|
|
7394
|
+
let { maxRow: n, maxCol: r } = zo(e);
|
|
7395
|
+
n += 30, r += 10;
|
|
7396
|
+
let i = $(e).roundedContentExtent(n, r, t, 50, 22), a = i.width, o = i.height;
|
|
7397
|
+
this.spacer.style.width = `${a}px`, this.spacer.style.height = `${o}px`, this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.viewport.setExtent(a, o), this.setViewportLeft(this.viewport.x), this.viewportTop = this.viewport.y;
|
|
7335
7398
|
}
|
|
7336
7399
|
scheduleRender() {
|
|
7337
7400
|
this.renderDispatcher.schedule(() => this.renderCurrentSheet().catch((e) => this._reportRenderError(e)));
|
|
@@ -7415,17 +7478,17 @@ var xs = class {
|
|
|
7415
7478
|
destroyedError() {
|
|
7416
7479
|
return /* @__PURE__ */ Error(this._mountKind === "sheet" ? "XlsxSheetViewer is destroyed" : "XlsxViewer is destroyed");
|
|
7417
7480
|
}
|
|
7418
|
-
},
|
|
7481
|
+
}, Cs = class e extends Ss {
|
|
7419
7482
|
static fromWorkbook(t, n, r = {}) {
|
|
7420
7483
|
return new e(t, {
|
|
7421
7484
|
...r,
|
|
7422
|
-
[
|
|
7485
|
+
[Bo]: n
|
|
7423
7486
|
});
|
|
7424
7487
|
}
|
|
7425
7488
|
constructor(e, t = {}) {
|
|
7426
7489
|
super(e, t, { kind: "composite" });
|
|
7427
7490
|
}
|
|
7428
|
-
},
|
|
7491
|
+
}, ws = class e {
|
|
7429
7492
|
engine;
|
|
7430
7493
|
canvasMount;
|
|
7431
7494
|
destroyed = !1;
|
|
@@ -7434,16 +7497,16 @@ var xs = class {
|
|
|
7434
7497
|
static fromWorkbook(t, n, r = {}) {
|
|
7435
7498
|
return new e(t, {
|
|
7436
7499
|
...r,
|
|
7437
|
-
[
|
|
7500
|
+
[Bo]: n
|
|
7438
7501
|
});
|
|
7439
7502
|
}
|
|
7440
7503
|
constructor(e, t = {}) {
|
|
7441
7504
|
this.canvasElement = e;
|
|
7442
|
-
let n = t[
|
|
7443
|
-
this.canvasMount = new
|
|
7505
|
+
let n = t[Bo], r = Ce("XlsxSheetViewer", t.mode, n), i = e.getBoundingClientRect();
|
|
7506
|
+
this.canvasMount = new Ee(e, {
|
|
7444
7507
|
wrapperCssText: `position:relative;display:inline-block;vertical-align:top;overflow:hidden;width:${e.style.width || `${i.width || e.width}px`};height:${e.style.height || `${i.height || e.height}px`};`,
|
|
7445
7508
|
restoreMode: "style-and-bitmap"
|
|
7446
|
-
}), this.engine = new
|
|
7509
|
+
}), this.engine = new Ss(this.canvasMount.wrapper, {
|
|
7447
7510
|
...t,
|
|
7448
7511
|
onResourceMetrics: (e) => {
|
|
7449
7512
|
this.lastMetrics = e, t.onResourceMetrics?.(e);
|
|
@@ -7600,20 +7663,20 @@ var xs = class {
|
|
|
7600
7663
|
destroyedError() {
|
|
7601
7664
|
return /* @__PURE__ */ Error("XlsxSheetViewer is destroyed");
|
|
7602
7665
|
}
|
|
7603
|
-
},
|
|
7666
|
+
}, Ts = /* @__PURE__ */ e({
|
|
7604
7667
|
MAX_SELECTION_AREAS: () => 128,
|
|
7605
7668
|
MAX_SELECTION_CONTEXT_CELLS: () => io,
|
|
7606
7669
|
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () => ao,
|
|
7607
7670
|
OoxmlDecodedImageLimitError: () => l,
|
|
7608
|
-
OoxmlError: () =>
|
|
7609
|
-
OoxmlResourceLimitError: () =>
|
|
7610
|
-
XlsxSheetViewer: () =>
|
|
7611
|
-
XlsxViewer: () =>
|
|
7671
|
+
OoxmlError: () => re,
|
|
7672
|
+
OoxmlResourceLimitError: () => le,
|
|
7673
|
+
XlsxSheetViewer: () => ws,
|
|
7674
|
+
XlsxViewer: () => Cs,
|
|
7612
7675
|
XlsxWorkbook: () => Ra,
|
|
7613
|
-
autoResize: () =>
|
|
7676
|
+
autoResize: () => ke,
|
|
7614
7677
|
isOoxmlDecodedImageLimitError: () => f,
|
|
7615
|
-
openExternalHyperlink: () =>
|
|
7616
|
-
resolveSharedStrings: () =>
|
|
7678
|
+
openExternalHyperlink: () => O,
|
|
7679
|
+
resolveSharedStrings: () => Ye
|
|
7617
7680
|
});
|
|
7618
7681
|
//#endregion
|
|
7619
|
-
export { io as a, ro as i,
|
|
7682
|
+
export { io as a, ro as i, ws as n, ao as o, Cs as r, Ra as s, Ts as t };
|