@silurus/ooxml 0.89.10 → 0.89.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{render-worker-jGsxSIGb.js → render-worker-BD7EhV2y.js} +17 -17
- package/dist/assets/render-worker-BiKxVVB1.js +16 -0
- package/dist/assets/{render-worker-Coh33rbW.js → render-worker-CVqXtEMW.js} +13 -13
- package/dist/{bounded-raw-part-cache-B5a6cGKO.js → bounded-raw-part-cache-D2Q0FIoE.js} +719 -663
- package/dist/{canvas-viewer-mechanics-BsqaoYgK.js → canvas-viewer-mechanics-_ZBxW_sN.js} +1 -1
- package/dist/{comment-overlay-controller-b3tKmzMa.js → comment-overlay-controller-CVvQCYhQ.js} +8 -8
- package/dist/{comment-ui-runtime-Bp37ytDC.js → comment-ui-runtime-CYkt_9-b.js} +2 -2
- package/dist/{comment-ui-runtime-BkpFlPT0.js → comment-ui-runtime-DhTTGSay.js} +3 -3
- package/dist/{document-model-source-Ca2fk_Fc.js → document-model-source-C6wGN8m3.js} +45 -45
- package/dist/{document-pull-client-CTGM4i1m.js → document-pull-client-BfGXPuQc.js} +4117 -4128
- package/dist/{document-pull-worker-hMKJ5RdB.js → document-pull-worker-Bl3wlLXC.js} +4 -4
- package/dist/{docx-B-47Ff78.js → docx-CNscQaT8.js} +496 -496
- package/dist/{docx-DwdB7I59.js → docx-Cry-eklK.js} +7 -7
- package/dist/{docx-model-source-CWuvf9jk.js → docx-model-source-Cj8DGdLl.js} +6 -6
- package/dist/docx.mjs +3 -3
- package/dist/{drawingml-shape-B1_kg4BV.js → drawingml-shape-CFzAXuvj.js} +88 -116
- package/dist/{font-preload-demand-NqcVKIpX.js → font-preload-demand-DhFVOxz4.js} +1 -1
- package/dist/{host-layout-measure-IFLllYwV.js → host-layout-measure-CWKDrVpo.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal-companion.mjs +2 -2
- package/dist/{line-distribute-CwtditQo.js → line-distribute-DxnuaRdO.js} +24 -24
- package/dist/{model-source-Cch44xsb.js → model-source-DksDDVb4.js} +1 -1
- package/dist/{model-source-session-DRcqFGfM.js → model-source-session-8wqlNxsQ.js} +2 -2
- package/dist/{model-source-session-ClNCRDOg.js → model-source-session-BogYRDwj.js} +2 -2
- package/dist/{model-source-session-DSABX94B.js → model-source-session-ifwyPPhZ.js} +2 -2
- package/dist/node.mjs +4 -4
- package/dist/{pptx-DbjWegUB.js → pptx-Bons7t3Y.js} +26 -26
- package/dist/{pptx-C1CiFW1D.js → pptx-CQtPbMxI.js} +10 -10
- package/dist/{pptx-model-source-C9TuBisH.js → pptx-model-source-mg-O0LR9.js} +5 -5
- package/dist/pptx.mjs +4 -4
- package/dist/{presentation-model-source-DLNioq7T.js → presentation-model-source-CK6_hY1W.js} +5 -5
- package/dist/{render-Bf_Gywxw.js → render-C7F07FrC.js} +2 -2
- package/dist/{render-worker-host-80mSndWp.js → render-worker-host-Cj-U3WPe.js} +1 -1
- package/dist/{render-worker-host-CVr53kg0.js → render-worker-host-D7L6GMbE.js} +1 -1
- package/dist/{render-worker-host-pKls3F_t.js → render-worker-host-stI5Lppz.js} +1 -1
- package/dist/{renderer-DuYC3xXi.js → renderer-N76SnQW7.js} +1286 -1212
- package/dist/{resource-measurement-CfJtbwiR.js → resource-measurement-B2hzmYlu.js} +90 -90
- package/dist/{session-DPXK_lpI.js → session-D5au4i-W.js} +166 -166
- package/dist/{slide-pull-client-3g6TxaKa.js → slide-pull-client-3mJmNjjB.js} +854 -904
- package/dist/{wasm-runtime-generation-D97yoAXz.js → wasm-runtime-generation--_2SjW2G.js} +1 -1
- package/dist/{workbook-model-source-D1dmkDMP.js → workbook-model-source-CI1q6nxK.js} +6 -6
- package/dist/{worksheet-pull-client-BudfclVl.js → worksheet-pull-client-C2h4AMwt.js} +18 -18
- package/dist/{xlsx-DBhYlJKp.js → xlsx-CKXeKvxl.js} +452 -452
- package/dist/{xlsx-DA0uR1B1.js → xlsx-DujIp7CR.js} +4 -4
- package/dist/{xlsx-model-source-zemVDAfl.js → xlsx-model-source-fs0svOUo.js} +6 -6
- package/dist/xlsx.mjs +4 -4
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-Ck21oePL.js +0 -16
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as e } from "./chunk-D5OxutzX.js";
|
|
2
2
|
import { Co as t, Er as n, Fa as r, Ia as i, Pa as a, Tr as o, Yn as s, a as c, c as l, d as u, h as d, m as f, o as p, r as m, u as h, wo as g, wr as _ } from "./plot-area-frame-DNYMd9Pf.js";
|
|
3
3
|
import { n as v, t as y } from "./cfb-guard-DzYlucez.js";
|
|
4
|
-
import { $ as b,
|
|
5
|
-
import { f as
|
|
6
|
-
import { L as
|
|
7
|
-
import { i as
|
|
8
|
-
import { C as
|
|
9
|
-
import { A as
|
|
10
|
-
import { n as
|
|
11
|
-
import { _ as
|
|
12
|
-
import { n as
|
|
13
|
-
import { a as
|
|
14
|
-
var en = "var e=(e,t)=>()=>(e&&(t=e(e=0)),t);function t(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 n,r,i=e((()=>{n=class e extends Error{code;details;constructor(t,n,r){super(n),this.name=`OoxmlError`,this.code=t,t===`unsupported-content`&&r&&(this.details=Object.freeze({format:r.format,reason:r.reason})),Object.setPrototypeOf(this,e.prototype)}},r=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)}}}));function a(e){return e===`image-dimension`||e===`image-pixels`||e===`active-decoded-bytes`||e===`image-effect-count`||e===`image-effect-work`||e===`tiff-lzw-work`||e===`metafile-path-commands`||e===`metafile-record-points`||e===`metafile-record-polygons`||e===`metafile-record-rectangles`||e===`metafile-record-text-units`}function o(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function s(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,r=t.metric,i=t.limit,s=t.observed;return n!==`ooxml-decoded-image-limit`||!a(r)||!o(i)||!o(s)||s<=i?void 0:{metric:r,limit:i,observed:s}}catch{return}}var c,l,u,d,ee,te=e((()=>{c=1<<25,l=1<<27,c*4,l*4,u=Math.floor(c/4),d=l,d/u,ee=class e extends RangeError{metric;limit;observed;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 ne(e){if(!(typeof e!=`object`||!e))try{let t=e,n=t.code,r=t.message;return n===`ooxml-tiff-decode`&&typeof r==`string`?{message:r}:void 0}catch{return}}var re=e((()=>{}));function f(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function ie(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return f(t.requiredBytes)&&f(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var p=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 ae(e){if(e instanceof p)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`||!ie(r)))return new p(r)}i(),te(),re();const m=`OOXML_RESOURCE_LIMIT:`;function h(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function oe(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return h(t.archiveEntryCount)&&h(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||h(t.largestInflatedEntryBytes))&&h(t.distinctInflatedBytes)&&h(t.operationInflatedBytes)}function g(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{throw TypeError(`OOXML resource usage checkpoint is not valid JSON`)}if(!oe(t))throw TypeError(`OOXML resource usage checkpoint is invalid`);return t}function se(e){return e===`docx`||e===`xlsx`||e===`pptx`}function ce(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function _(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function v(e){return _(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function le(e){return!_(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 y=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}],[`image-effect:work`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:elements`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-cache:points`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`numbering-marker:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-style-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-custom-number-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-number-format-bytes:bytes`,{stage:`parsing`,part:`required`,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}],[`theme-style-reparse:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`style-inheritance:depth`,{stage:`parsing`,part:`required`,configurable:!1}],[`complex-field:depth`,{stage:`parsing`,part:`forbidden`,configurable:!1}]]),ue=new Set([...y.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),de=new Set([...y.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function fe(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!se(t.format)||!_(t.operation,256)||!v(t.resource)||!v(t.metric)||!h(t.limit)||!h(t.observed)||typeof t.configurable!=`boolean`||!oe(t.usage)?!1:!(`part`in t)||le(t.part)}function b(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!ce(t.stage)||!fe(t.violation))return!1;let n=t.violation,r=y.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:!(ue.has(n.resource)&&de.has(n.metric))}function pe(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function me(e){if(!b(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:pe(t.usage)}};return b(n)?n:void 0}function x(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``} (${t.resource}, ${e.stage}): ${t.metric} ${t.observed} > ${t.limit}`}function S(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(m))return;let n;try{n=JSON.parse(t.slice(21))}catch{return}if(!n||typeof n!=`object`)return;let i=n;if(!(i.code!==`ooxml-resource-limit`||!b(i.details)))return new r(x(i.details),i.details)}function he(e){try{return e()}catch(e){throw e instanceof r||typeof e!=`string`&&!(e instanceof Error)?e:S(e)??e}}function ge(e){let t=e instanceof Error?e.message:String(e);if(t.startsWith(`OOXML_NOT_OOXML:`))return new n(`not-ooxml`,`This file is not an Office Open XML document: ${t.slice(16)}`)}function C(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.format,r=t.reason;if(!(!v(n)||r!==`source-subset`))return{format:n,reason:r}}function _e(e){return new n(`unsupported-content`,`Input is outside the source’s supported subset.`,e)}function ve(e){let t=typeof e==`string`?e:e instanceof Error?e.message:``;if(!(!t.startsWith(`MODEL_SOURCE_UNSUPPORTED:`)||t.length>1024))try{let e=C(JSON.parse(t.slice(25)));return e?_e(e):void 0}catch{return}}function ye(e){return e===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`||e instanceof Error&&e.message===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`?new n(`unsupported-encryption`,`The configured source cannot decrypt this input.`):ve(e)??S(e)??ge(e)}function be(e){let t=s(e);if(t){let e=new ee(t.metric,t.limit,t.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:t}}let i=ne(e);if(i)return{message:i.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let a=ae(e);if(a)return{message:a.message,errorName:a.name,code:a.code,insufficientCredit:{requiredBytes:a.requiredBytes,offeredBytes:a.offeredBytes}};let o=e instanceof n||e instanceof r?e:ye(e),c=o??e;if(o instanceof r||c&&typeof c==`object`&&c.code===`ooxml-resource-limit`){let e=c,t=me(e.details);return t?{message:typeof e.message==`string`?e.message:x(t),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:t}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(c&&typeof c==`object`&&c.code===`unsupported-content`){let e=C(c.details);return e?{message:_e(e).message,code:`unsupported-content`,unsupportedContent:e}:{message:`Invalid unsupported-content error payload`,errorName:`Error`}}if(o instanceof n)return{message:typeof o.message==`string`?o.message:String(o.message),errorName:_(o.name,128)?o.name:`OoxmlError`,...v(o.code)?{code:o.code}:{}};let l=e instanceof Error?e.message:String(e);if(typeof l==`string`&&l.startsWith(m))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let u=e instanceof Error?e:Error(l),d=u;return{message:typeof u.message==`string`?u.message:String(u.message),errorName:_(u.name,128)?u.name:`Error`,...typeof d.code==`string`?{code:d.code}:{}}}function w(e){try{return be(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}var xe=class{initialize;reinitialize;normalizeFailure;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`)}},T=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function Se(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 Ce(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 we(e,t){return e({module_or_path:t})}var Te=class{init;options;runtime;wasmInput=null;currentArchive=null;constructor(e,t={}){this.init=e,this.options=t,this.runtime=new xe(()=>this.invokeConfigured(this.init),()=>this.invokeConfigured(this.options.reinit??this.init),Ee),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 he(()=>this.runtime.run(e))}poison(){this.runtime.poison(new T(`WASM parser was recycled`))}invokeConfigured(e){return this.wasmInput===null?Promise.reject(Error(`WasmParserHost: setWasmInput was never called`)):we(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,Ce(e)}};function Ee(e){return Se(e)?new T(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`):null}function De(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 Oe(e){return[e.maxArchiveEntryBytes===null?0n:BigInt(e.maxArchiveEntryBytes),e.maxTotalInflatedBytes===null?0n:BigInt(e.maxTotalInflatedBytes),e.maxArchiveEntries===null?0n:BigInt(e.maxArchiveEntries)]}const E=`ooxml-pull-v1`;function D(e,t){if(!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} must be a positive safe integer`)}function ke(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 Ae=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,D(this.maxRetainedBytes,`max retained lease bytes`),D(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}},je=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){ke(e.sessionId),D(e.operationId,`operation id`),D(e.generation,`generation`),D(e.maxByteCredit,`max byte credit`),e.wireLeaseIdStart!==void 0&&D(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=w(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(D(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:E,...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){D(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(D(e,`byte credit`),e>this.options.maxByteCredit)throw RangeError(`byte credit exceeds host maximum`)}accepted(e,t,n=!1){return{kind:`accepted`,protocol:E,...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:E,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}}};const O=2**53-1-1;function k(e){return Object.freeze({maxRows:e.maxRows,maxCells:e.maxCells,maxOwnedUtf8Bytes:e.maxOwnedUtf8Bytes,maxJsonBytes:e.maxJsonBytes})}const A=Object.freeze({worksheet:k({maxRows:1e5,maxCells:25e4,maxOwnedUtf8Bytes:33554432,maxJsonBytes:67108864}),cache:k({maxRows:2e5,maxCells:5e5,maxOwnedUtf8Bytes:67108864,maxJsonBytes:134217728}),maxCoordinateIndexEntries:25e4});function j(e,t){let n=e[t];if(n===void 0)return A.worksheet[t];if(typeof n!=`number`)throw TypeError(`xlsxWorksheetLimits.${t} must be a number`);if(!Number.isSafeInteger(n)||n<=0||n>O)throw RangeError(`xlsxWorksheetLimits.${t} must be a positive safe integer no greater than ${O}`);return n}function Me(e={}){let t=e.xlsxWorksheetLimits,n={};if(t!==void 0){if(typeof t!=`object`||!t||Array.isArray(t))throw TypeError(`xlsxWorksheetLimits must be a non-null, non-array object`);n=t}let r=k({maxRows:j(n,`maxRows`),maxCells:j(n,`maxCells`),maxOwnedUtf8Bytes:j(n,`maxOwnedUtf8Bytes`),maxJsonBytes:j(n,`maxJsonBytes`)}),i=A,a=k({maxRows:Math.max(i.cache.maxRows,r.maxRows),maxCells:Math.max(i.cache.maxCells,r.maxCells),maxOwnedUtf8Bytes:Math.max(i.cache.maxOwnedUtf8Bytes,r.maxOwnedUtf8Bytes),maxJsonBytes:Math.max(i.cache.maxJsonBytes,r.maxJsonBytes)});return Object.freeze({worksheet:r,cache:a,maxCoordinateIndexEntries:Math.max(i.maxCoordinateIndexEntries,r.maxCells)})}function Ne(e){let{worksheet:t}=e;return[BigInt(t.maxRows),BigInt(t.maxCells),BigInt(t.maxOwnedUtf8Bytes),BigInt(t.maxJsonBytes)]}var M=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();K.__wbg_xlsxarchive_free(e,0)}acknowledge_sheet_cursor_terminal(){let e=K.xlsxarchive_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);if(e[1])throw V(e[0])}assert_healthy(){let e=K.xlsxarchive_assert_healthy(this.__wbg_ptr);if(e[1])throw V(e[0])}cancel_sheet_cursor(){K.xlsxarchive_cancel_sheet_cursor(this.__wbg_ptr)}close_sheet_cursor(){K.xlsxarchive_close_sheet_cursor(this.__wbg_ptr)}extract_image(e){let t=B(e,K.__wbindgen_malloc,K.__wbindgen_realloc),n=G,r=K.xlsxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw V(r[2]);var i=P(r[0],r[1]).slice();return K.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t,n,r){let i=Ie(e,K.__wbindgen_malloc),a=G,o=K.xlsxarchive_new(i,a,!z(t),z(t)?BigInt(0):t,!z(n),z(n)?BigInt(0):n,!z(r),z(r)?BigInt(0):r);if(o[2])throw V(o[1]);return this.__wbg_ptr=o[0]>>>0,N.register(this,this.__wbg_ptr,this),this}open_sheet_cursor(e,t){let n=B(t,K.__wbindgen_malloc,K.__wbindgen_realloc),r=G,i=K.xlsxarchive_open_sheet_cursor(this.__wbg_ptr,e,n,r);if(i[1])throw V(i[0])}parse(){let e=K.xlsxarchive_parse(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}pull_sheet_cursor(e){let t=K.xlsxarchive_pull_sheet_cursor(this.__wbg_ptr,e);if(t[3])throw V(t[2]);var n=P(t[0],t[1]).slice();return K.__wbindgen_free(t[0],t[1]*1,1),n}resource_usage(){let e=K.xlsxarchive_resource_usage(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}set_worksheet_limits(e,t,n,r){let i=K.xlsxarchive_set_worksheet_limits(this.__wbg_ptr,e,t,n,r);if(i[1])throw V(i[0])}sheet_cursor_pull_finished(){return K.xlsxarchive_sheet_cursor_pull_finished(this.__wbg_ptr)!==0}sheet_cursor_resource_usage(){let e=K.xlsxarchive_sheet_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=K.xlsxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,V(i[2]);return e=n,t=r,I(n,r)}finally{K.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(M.prototype[Symbol.dispose]=M.prototype.free);function Pe(){return{__proto__:null,\"./xlsx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(I(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(I(e,t))}finally{K.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=B(n,K.__wbindgen_malloc,K.__wbindgen_realloc),i=G;Fe().setInt32(e+4,i,!0),Fe().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return I(e,t)},__wbindgen_init_externref_table:function(){let e=K.__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=>K.__wbg_xlsxarchive_free(e>>>0,1));function P(e,t){return e>>>=0,R().subarray(e/1,e/1+t)}let F=null;function Fe(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==K.memory.buffer)&&(F=new DataView(K.memory.buffer)),F}function I(e,t){return e>>>=0,Le(e,t)}let L=null;function R(){return(L===null||L.byteLength===0)&&(L=new Uint8Array(K.memory.buffer)),L}function z(e){return e==null}function Ie(e,t){let n=t(e.length*1,1)>>>0;return R().set(e,n/1),G=e.length,n}function B(e,t,n){if(n===void 0){let n=W.encode(e),r=t(n.length,1)>>>0;return R().subarray(r,r+n.length).set(n),G=n.length,r}let r=e.length,i=t(r,1)>>>0,a=R(),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=R().subarray(i+o,i+r),a=W.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return G=o,i}function V(e){let t=K.__wbindgen_externrefs.get(e);return K.__externref_table_dealloc(e),t}let H=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});H.decode();let U=0;function Le(e,t){return U+=t,U>=2146435072&&(H=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),H.decode(),U=t),H.decode(R().subarray(e,e+t))}const W=new TextEncoder;`encodeInto`in W||(W.encodeInto=function(e,t){let n=W.encode(e);return t.set(n),{read:e.length,written:n.length}});let G=0,K;function Re(e,t){return K=e.exports,F=null,L=null,K.__wbindgen_start(),K}async function ze(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 Be(e){if(K!==void 0)return K;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 t=Pe();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await ze(await e,t);return Re(n,r)}async function Ve(e){return K=void 0,F=null,L=null,Be(e)}function He(e,t){return{workbook:e(),usage:g(t())}}function Ue(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}const We=new Set([`outline`,`merge`,`conditional-format`,`ancillary-content`,`metadata-unavailable`,`unordered-rows`]);function Ge(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&&Ue(o.rows,n),r?.(o.rows),{kind:`rows`,rows:o.rows}}if(o.kind===`preview`){if(!Number.isSafeInteger(o.maxRow)||!Number.isSafeInteger(o.maxCol)||o.maxRow<0||o.maxCol<0||o.worksheet===null==(o.reason===null)||o.worksheet!==null&&(typeof o.worksheet!=`object`||Array.isArray(o.worksheet))||o.reason!==null&&!We.has(o.reason))throw Error(`worksheet preview unit is invalid`);return o.worksheet&&(o.worksheet.rows=[]),o}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`)}const Ke=new WeakMap;function qe(e,t){Ke.set(e,t)}function q(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function J(e,t,n){return q(e,`resource measurement`),q(t,`resource measurement`),q(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function Je(e,t=2**53-1){q(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=J(n,a,t),n>t)return n}return n}function Ye(e,t=2**53-1){q(t,`resource measurement limit`);let n=J(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=J(n,a,t),n>t)return n}return n}function Y(e,t){return J(0,e,t)}function X(e,t=2**53-1,n=!1){if(q(t,`resource measurement limit`),e===null)return{jsonBytes:Y(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:Ye(e,t),stringValueUtf8Bytes:Je(e,t)};if(typeof e==`boolean`)return{jsonBytes:Y(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:Y((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=Y(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=J(n,1,t));let a=X(e[i],t,!0);n=J(n,a.jsonBytes,t),r=J(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=Y(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=J(n,1,t)),n=J(n,Ye(a,t),t),n=J(n,1,t);let e=X(o,t);n=J(n,e.jsonBytes,t),r=J(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?Y(4,t):0,stringValueUtf8Bytes:0}}i();const Xe=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function Ze(e,t=A){let{maxCells:n,maxOwnedUtf8Bytes:r}=t.worksheet,i=e.reduce((e,t)=>J(e,t.cells.length,n),0);return{rows:e.length,cells:i,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=X(t.value,r).stringValueUtf8Bytes;return J(e,J(n,t.formula===void 0?0:Je(t.formula,r),r),r)},e),0)}}function Qe(e,t,n=A){let r=X(e,n.worksheet.maxJsonBytes);return{...t,jsonBytes:r.jsonBytes}}function $e(e,t,n=A){let r=n.worksheet;return{rows:J(e.rows,t.rows,r.maxRows),cells:J(e.cells,t.cells,r.maxCells),ownedUtf8Bytes:J(e.ownedUtf8Bytes,t.ownedUtf8Bytes,r.maxOwnedUtf8Bytes)}}function et(e,t,n,i,a,o,s,c=n!==`delimited-text-source`){let l=n===`worksheet-json`?`serialization`:`parsing`;return new r(x({stage:l,violation:{part:t,resource:n,metric:i,observed:o,limit:a}}),{stage:l,violation:{format:`xlsx`,operation:e,resource:n,metric:i,...t===void 0?{}:{part:t},limit:a,observed:Math.min(o,a+1),configurable:c,usage:s??Xe}})}function tt(e,t,n,r,i=A){let a=i.worksheet,o=[[`rows`,e.rows,a.maxRows],[`cells`,e.cells,a.maxCells],[`owned-utf8-bytes`,e.ownedUtf8Bytes,a.maxOwnedUtf8Bytes]];for(let[e,i,a]of o)if(i>a)throw et(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,a,i,r)}function nt(e,t,n,r,i=A){let a=i.worksheet.maxJsonBytes;if(e>a)throw et(t,n,`worksheet-json`,`bytes`,a,e,r)}i();var rt=class{archive;acceptWorksheet;executeArchive;prepareRows;provisional;worksheetPolicy;coordinator=new Ae;sessions=new Map;operationTail=Promise.resolve();pendingOpens=new Map;resourceFailure;constructor(e,t,n=e=>e(this.requireArchive()),r,i,a=()=>A){this.archive=e,this.acceptWorksheet=t,this.executeArchive=n,this.prepareRows=r,this.provisional=i,this.worksheetPolicy=a}reserveOpen(e){this.pendingOpens.set(e.sessionId,{identity:e,canceled:!1})}abandonOpen(e){this.pendingOpens.delete(e)}get pendingOpenCount(){return this.pendingOpens.size}runDuringPull(e){return this.sessions.size===0?this.run(e):this.coordinator.enqueue(async()=>{if(this.resourceFailure)throw this.resourceFailure;try{return e()}catch(e){throw e instanceof r&&(this.resourceFailure??=e),e}})}async open(e,t,n){if(this.resourceFailure)throw this.resourceFailure;let i=this.pendingOpens.get(n.sessionId);if(!i||i.identity.operationId!==n.operationId||i.identity.generation!==n.generation)throw Error(`worksheet pull session open reservation is stale or missing`);let a=this.worksheetPolicy(),o,s=new Promise(e=>{o=e}),c=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(i.canceled)throw Error(`worksheet pull session open was canceled`);this.executeArchive(n=>n.open_sheet_cursor(e,t));let s=[],c={rows:0,cells:0,ownedUtf8Bytes:0},l,u=!1,d=new je({...n,maxByteCredit:67108864,coordinator:this.coordinator,driver:{pull:()=>{let t=this.executeArchive(e=>e.pull_sheet_cursor(128)),n=this.executeArchive(e=>e.sheet_cursor_pull_finished());if(this.acceptWorksheet){let i=Ge(t,n,void 0,this.prepareRows);try{if(i.kind===`preview`)i.worksheet&&(i.worksheet.rows=s,qe(i.worksheet,a),this.provisional?.preview(e,i.worksheet));else if(i.kind===`rows`){let e=$e(c,Ze(i.rows,a),a);tt(e,`get-worksheet-worker`,void 0,this.readResourceUsage(),a),s.push(...i.rows),c=e}else i.kind===`finished`&&(l=i.worksheet)}catch(e){throw e instanceof r&&(this.resourceFailure??=e),e}}u=n;let i=De(t);return{payload:i,byteLength:i.byteLength,done:n,transfer:[i]}},measureChunk:({payload:e})=>e.byteLength,acknowledge:()=>{if(!u)return;let t,i;try{if(this.acceptWorksheet){if(!l)throw Error(`worksheet terminal payload is missing`);l.rows=l.parseError?[]:s;let n=l.parseError?{rows:0,cells:0,ownedUtf8Bytes:0}:c,r=Qe(l,n,a),o=this.readResourceUsage();tt(r,`get-worksheet-worker`,void 0,o,a),nt(r.jsonBytes,`get-worksheet-worker`,void 0,o,a),qe(l,a);let u=this.acceptWorksheet(e,l,r,o);typeof u==`function`?t=u:u&&({rollback:t,commit:i}=u)}this.executeArchive(e=>e.acknowledge_sheet_cursor_terminal()),i?.()}catch(e){throw t?.(),e instanceof r&&(this.resourceFailure??=e),e}u=!1,this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()},cancel:()=>{try{this.archive()&&this.executeArchive(e=>e.cancel_sheet_cursor())}finally{this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()}},close:()=>{try{this.archive()&&this.executeArchive(e=>e.close_sheet_cursor())}finally{this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()}},resourceUsage:()=>this.readResourceUsage()}});this.sessions.set(n.sessionId,{host:d,identity:n}),this.pendingOpens.delete(n.sessionId)}));this.operationTail=c.then(()=>s,()=>void 0);try{await c}catch(e){throw this.pendingOpens.delete(n.sessionId),o(),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:E,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}:{protocol:E,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:E,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}),Promise.resolve()):(t({protocol:E,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:w(Error(`worksheet pull session is not open`))}),Promise.resolve())}async dispatchSafely(e,t){try{await this.dispatch(e,t)}catch(n){try{t({protocol:E,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:w(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 r&&(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:E,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:E,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(){return g(this.executeArchive(e=>e.sheet_cursor_resource_usage()))}};function it(e){return!!e&&typeof e==`object`&&e.protocol===`ooxml-pull-v1`}const Z=new Te(Be,{freeArchive:e=>e.free(),reinit:Ve});let Q=A;const $=new rt(()=>Z.archive,void 0,e=>{let t=Z.archive;if(!t)throw Error(`Workbook not loaded`);return Z.run(()=>e(t))},void 0,void 0,()=>Q);self.onmessage=async e=>{let n=e.data;if(it(n)){await $.dispatchSafely(n,(e,t)=>self.postMessage(e,t));return}if(n.type===`init`){Z.setWasmInput(t(n.wasmUrl)??n.wasmUrl);return}let r=n.id;n.type===`openSheetSession`&&$.reserveOpen(n);try{let e=n.type===`parse`?Me({xlsxWorksheetLimits:n.worksheetPolicy?.worksheet}):void 0;if(n.type===`openSheetSession`){await Z.ensureReady(),Z.archive&&Z.run(()=>Z.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,...w(e)}));return}n.type===`parse`&&await $.reset(),await(n.type===`extractImage`?$.runDuringPull:$.run).call($,async()=>{if(await Z.ensureReady(),n.type!==`parse`&&Z.archive){let e=Z.archive;Z.run(()=>e.assert_healthy())}if(n.type===`parse`){let[t,i,a]=Oe(n.resourcePolicy),o=new Uint8Array(n.data);Q=e??A;let s=Ne(Q),{workbook:c,usage:l}=He(()=>Z.run(()=>{let e=new M(o,t,i,a);return Z.setArchive(e),e.set_worksheet_limits(...s),e.parse()}),()=>Z.run(()=>Z.archive.resource_usage())),u=c.buffer,d={type:`parsed`,id:r,workbookJson:u,usage:l};self.postMessage(d,[u]);return}let t=Z.archive;if(n.type===`extractImage`){if(!t)throw Error(`No xlsx loaded`);let e=Z.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=Z.run(()=>g(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:Z.run(()=>t.to_markdown())};self.postMessage(e);return}})}catch(e){n.type===`openSheetSession`&&$.abandonOpen(n.sessionId);let t={type:`error`,id:r,...w(e)};try{self.postMessage(t)}catch{}}};", tn = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", en], { type: "text/javascript;charset=utf-8" });
|
|
15
|
-
function
|
|
4
|
+
import { $ as b, F as x, Fn as S, I as C, L as w, P as T, Pn as E, Q as D, Sn as O, St as k, W as A, at as j, bt as M, en as N, ft as P, ht as F, it as ee, lt as te, nn as ne, ot as re, p as ie, rn as I, t as ae, ut as L, xt as oe, yt as se } from "./bounded-raw-part-cache-D2Q0FIoE.js";
|
|
5
|
+
import { f as R, u as ce } from "./pixel-budget-DI82Hn3R.js";
|
|
6
|
+
import { L as le, R as ue, V as de, n as fe, t as pe } from "./renderer-DpTePxGq.js";
|
|
7
|
+
import { i as me, t as he } from "./tiff-contract-DEd8CGuz.js";
|
|
8
|
+
import { C as ge, D as _e, E as ve, S as ye, T as be, _ as xe, a as Se, b as Ce, d as we, f as Te, g as Ee, h as De, m as Oe, o as ke, p as Ae, t as je, u as Me, w as Ne, x as Pe, y as Fe } from "./canvas-viewer-mechanics-_ZBxW_sN.js";
|
|
9
|
+
import { A as Ie, B as Le, C as Re, D as ze, E as Be, F as Ve, G as He, H as Ue, I as We, L as Ge, M as z, N as Ke, O as qe, P as Je, R as Ye, S as Xe, T as Ze, U as Qe, V as $e, W as B, _ as et, b as V, c as tt, d as nt, f as rt, g as it, h as at, i as ot, j as st, k as ct, l as lt, m as ut, n as dt, o as ft, p as pt, r as mt, s as H, t as ht, u as gt, v as _t, w as vt, x as yt, y as bt, z as xt } from "./renderer-N76SnQW7.js";
|
|
10
|
+
import { n as St } from "./renderer-module-contract-BuTx2FWJ.js";
|
|
11
|
+
import { _ as Ct, a as wt, b as Tt, c as Et, d as Dt, f as Ot, g as kt, h as At, l as jt, m as Mt, n as Nt, o as Pt, p as Ft, s as It, t as Lt, u as Rt, v as U, y as zt } from "./worksheet-pull-client-C2h4AMwt.js";
|
|
12
|
+
import { n as Bt, r as Vt, t as Ht } from "./visible-index-vN-4BNn7.js";
|
|
13
|
+
import { a as Ut, c as Wt, d as Gt, f as Kt, l as W, n as G, o as qt, p as Jt, r as K, t as q, u as Yt } from "./grid-geometry-DpMAiSZb.js";
|
|
14
|
+
var Xt = "var e=(e,t)=>()=>(e&&(t=e(e=0)),t);function t(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 n,r,i=e((()=>{n=class e extends Error{code;details;constructor(t,n,r){super(n),this.name=`OoxmlError`,this.code=t,t===`unsupported-content`&&r&&(this.details=Object.freeze({format:r.format,reason:r.reason})),Object.setPrototypeOf(this,e.prototype)}},r=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)}}}));function a(e){return e===`image-dimension`||e===`image-pixels`||e===`active-decoded-bytes`||e===`image-effect-count`||e===`image-effect-work`||e===`tiff-lzw-work`||e===`metafile-path-commands`||e===`metafile-record-points`||e===`metafile-record-polygons`||e===`metafile-record-rectangles`||e===`metafile-record-text-units`}function o(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function s(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,r=t.metric,i=t.limit,s=t.observed;return n!==`ooxml-decoded-image-limit`||!a(r)||!o(i)||!o(s)||s<=i?void 0:{metric:r,limit:i,observed:s}}catch{return}}var c,l,u,d,ee,te=e((()=>{c=1<<25,l=1<<27,c*4,l*4,u=Math.floor(c/4),d=l,d/u,ee=class e extends RangeError{metric;limit;observed;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 ne(e){if(!(typeof e!=`object`||!e))try{let t=e,n=t.code,r=t.message;return n===`ooxml-tiff-decode`&&typeof r==`string`?{message:r}:void 0}catch{return}}var re=e((()=>{}));function f(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function ie(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return f(t.requiredBytes)&&f(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var p=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 ae(e){if(e instanceof p)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`||!ie(r)))return new p(r)}i(),te(),re();const m=`OOXML_RESOURCE_LIMIT:`;function h(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function oe(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return h(t.archiveEntryCount)&&h(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||h(t.largestInflatedEntryBytes))&&h(t.distinctInflatedBytes)&&h(t.operationInflatedBytes)}function g(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{throw TypeError(`OOXML resource usage checkpoint is not valid JSON`)}if(!oe(t))throw TypeError(`OOXML resource usage checkpoint is invalid`);return t}function se(e){return e===`docx`||e===`xlsx`||e===`pptx`}function ce(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function _(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function v(e){return _(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function le(e){return!_(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 y=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}],[`image-effect:work`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:elements`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-cache:points`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`numbering-marker:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-style-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-custom-number-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-number-format-bytes:bytes`,{stage:`parsing`,part:`required`,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}],[`theme-style-reparse:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`style-inheritance:depth`,{stage:`parsing`,part:`required`,configurable:!1}],[`complex-field:depth`,{stage:`parsing`,part:`forbidden`,configurable:!1}]]),ue=new Set([...y.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),de=new Set([...y.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function fe(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!se(t.format)||!_(t.operation,256)||!v(t.resource)||!v(t.metric)||!h(t.limit)||!h(t.observed)||typeof t.configurable!=`boolean`||!oe(t.usage)?!1:!(`part`in t)||le(t.part)}function b(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!ce(t.stage)||!fe(t.violation))return!1;let n=t.violation,r=y.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:!(ue.has(n.resource)&&de.has(n.metric))}function pe(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function me(e){if(!b(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:pe(t.usage)}};return b(n)?n:void 0}function x(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``} (${t.resource}, ${e.stage}): ${t.metric} ${t.observed} > ${t.limit}`}function S(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(m))return;let n;try{n=JSON.parse(t.slice(21))}catch{return}if(!n||typeof n!=`object`)return;let i=n;if(!(i.code!==`ooxml-resource-limit`||!b(i.details)))return new r(x(i.details),i.details)}function he(e){try{return e()}catch(e){throw e instanceof r||typeof e!=`string`&&!(e instanceof Error)?e:S(e)??e}}function ge(e){let t=e instanceof Error?e.message:String(e);if(t.startsWith(`OOXML_NOT_OOXML:`))return new n(`not-ooxml`,`This file is not an Office Open XML document: ${t.slice(16)}`)}function C(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.format,r=t.reason;if(!(!v(n)||r!==`source-subset`))return{format:n,reason:r}}function _e(e){return new n(`unsupported-content`,`Input is outside the source’s supported subset.`,e)}function ve(e){let t=typeof e==`string`?e:e instanceof Error?e.message:``;if(!(!t.startsWith(`MODEL_SOURCE_UNSUPPORTED:`)||t.length>1024))try{let e=C(JSON.parse(t.slice(25)));return e?_e(e):void 0}catch{return}}function ye(e){return e===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`||e instanceof Error&&e.message===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`?new n(`unsupported-encryption`,`The configured source cannot decrypt this input.`):ve(e)??S(e)??ge(e)}function be(e){let t=s(e);if(t){let e=new ee(t.metric,t.limit,t.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:t}}let i=ne(e);if(i)return{message:i.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let a=ae(e);if(a)return{message:a.message,errorName:a.name,code:a.code,insufficientCredit:{requiredBytes:a.requiredBytes,offeredBytes:a.offeredBytes}};let o=e instanceof n||e instanceof r?e:ye(e),c=o??e;if(o instanceof r||c&&typeof c==`object`&&c.code===`ooxml-resource-limit`){let e=c,t=me(e.details);return t?{message:typeof e.message==`string`?e.message:x(t),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:t}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(c&&typeof c==`object`&&c.code===`unsupported-content`){let e=C(c.details);return e?{message:_e(e).message,code:`unsupported-content`,unsupportedContent:e}:{message:`Invalid unsupported-content error payload`,errorName:`Error`}}if(o instanceof n)return{message:typeof o.message==`string`?o.message:String(o.message),errorName:_(o.name,128)?o.name:`OoxmlError`,...v(o.code)?{code:o.code}:{}};let l=e instanceof Error?e.message:String(e);if(typeof l==`string`&&l.startsWith(m))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let u=e instanceof Error?e:Error(l),d=u;return{message:typeof u.message==`string`?u.message:String(u.message),errorName:_(u.name,128)?u.name:`Error`,...typeof d.code==`string`?{code:d.code}:{}}}function w(e){try{return be(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}var xe=class{initialize;reinitialize;normalizeFailure;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`)}},T=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function Se(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 Ce(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 we(e,t){return e({module_or_path:t})}var Te=class{init;options;runtime;wasmInput=null;currentArchive=null;constructor(e,t={}){this.init=e,this.options=t,this.runtime=new xe(()=>this.invokeConfigured(this.init),()=>this.invokeConfigured(this.options.reinit??this.init),Ee),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 he(()=>this.runtime.run(e))}poison(){this.runtime.poison(new T(`WASM parser was recycled`))}invokeConfigured(e){return this.wasmInput===null?Promise.reject(Error(`WasmParserHost: setWasmInput was never called`)):we(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,Ce(e)}};function Ee(e){return Se(e)?new T(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`):null}function De(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 Oe(e){return[e.maxArchiveEntryBytes===null?0n:BigInt(e.maxArchiveEntryBytes),e.maxTotalInflatedBytes===null?0n:BigInt(e.maxTotalInflatedBytes),e.maxArchiveEntries===null?0n:BigInt(e.maxArchiveEntries)]}const E=`ooxml-pull-v1`;function D(e,t){if(!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} must be a positive safe integer`)}function ke(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 Ae=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,D(this.maxRetainedBytes,`max retained lease bytes`),D(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}},je=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){ke(e.sessionId),D(e.operationId,`operation id`),D(e.generation,`generation`),D(e.maxByteCredit,`max byte credit`),e.wireLeaseIdStart!==void 0&&D(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=w(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(D(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:E,...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){D(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(D(e,`byte credit`),e>this.options.maxByteCredit)throw RangeError(`byte credit exceeds host maximum`)}accepted(e,t,n=!1){return{kind:`accepted`,protocol:E,...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:E,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}}};const O=2**53-1-1;function k(e){return Object.freeze({maxRows:e.maxRows,maxCells:e.maxCells,maxOwnedUtf8Bytes:e.maxOwnedUtf8Bytes,maxJsonBytes:e.maxJsonBytes})}const A=Object.freeze({worksheet:k({maxRows:1e5,maxCells:25e4,maxOwnedUtf8Bytes:33554432,maxJsonBytes:67108864}),cache:k({maxRows:2e5,maxCells:5e5,maxOwnedUtf8Bytes:67108864,maxJsonBytes:134217728}),maxCoordinateIndexEntries:25e4});function j(e,t){let n=e[t];if(n===void 0)return A.worksheet[t];if(typeof n!=`number`)throw TypeError(`xlsxWorksheetLimits.${t} must be a number`);if(!Number.isSafeInteger(n)||n<=0||n>O)throw RangeError(`xlsxWorksheetLimits.${t} must be a positive safe integer no greater than ${O}`);return n}function Me(e={}){let t=e.xlsxWorksheetLimits,n={};if(t!==void 0){if(typeof t!=`object`||!t||Array.isArray(t))throw TypeError(`xlsxWorksheetLimits must be a non-null, non-array object`);n=t}let r=k({maxRows:j(n,`maxRows`),maxCells:j(n,`maxCells`),maxOwnedUtf8Bytes:j(n,`maxOwnedUtf8Bytes`),maxJsonBytes:j(n,`maxJsonBytes`)}),i=A,a=k({maxRows:Math.max(i.cache.maxRows,r.maxRows),maxCells:Math.max(i.cache.maxCells,r.maxCells),maxOwnedUtf8Bytes:Math.max(i.cache.maxOwnedUtf8Bytes,r.maxOwnedUtf8Bytes),maxJsonBytes:Math.max(i.cache.maxJsonBytes,r.maxJsonBytes)});return Object.freeze({worksheet:r,cache:a,maxCoordinateIndexEntries:Math.max(i.maxCoordinateIndexEntries,r.maxCells)})}function Ne(e){let{worksheet:t}=e;return[BigInt(t.maxRows),BigInt(t.maxCells),BigInt(t.maxOwnedUtf8Bytes),BigInt(t.maxJsonBytes)]}var M=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();K.__wbg_xlsxarchive_free(e,0)}acknowledge_sheet_cursor_terminal(){let e=K.xlsxarchive_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);if(e[1])throw V(e[0])}assert_healthy(){let e=K.xlsxarchive_assert_healthy(this.__wbg_ptr);if(e[1])throw V(e[0])}cancel_sheet_cursor(){K.xlsxarchive_cancel_sheet_cursor(this.__wbg_ptr)}close_sheet_cursor(){K.xlsxarchive_close_sheet_cursor(this.__wbg_ptr)}extract_image(e){let t=B(e,K.__wbindgen_malloc,K.__wbindgen_realloc),n=G,r=K.xlsxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw V(r[2]);var i=P(r[0],r[1]).slice();return K.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t,n,r){let i=Ie(e,K.__wbindgen_malloc),a=G,o=K.xlsxarchive_new(i,a,!z(t),z(t)?BigInt(0):t,!z(n),z(n)?BigInt(0):n,!z(r),z(r)?BigInt(0):r);if(o[2])throw V(o[1]);return this.__wbg_ptr=o[0]>>>0,N.register(this,this.__wbg_ptr,this),this}open_sheet_cursor(e,t){let n=B(t,K.__wbindgen_malloc,K.__wbindgen_realloc),r=G,i=K.xlsxarchive_open_sheet_cursor(this.__wbg_ptr,e,n,r);if(i[1])throw V(i[0])}parse(){let e=K.xlsxarchive_parse(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}pull_sheet_cursor(e){let t=K.xlsxarchive_pull_sheet_cursor(this.__wbg_ptr,e);if(t[3])throw V(t[2]);var n=P(t[0],t[1]).slice();return K.__wbindgen_free(t[0],t[1]*1,1),n}resource_usage(){let e=K.xlsxarchive_resource_usage(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}set_worksheet_limits(e,t,n,r){let i=K.xlsxarchive_set_worksheet_limits(this.__wbg_ptr,e,t,n,r);if(i[1])throw V(i[0])}sheet_cursor_pull_finished(){return K.xlsxarchive_sheet_cursor_pull_finished(this.__wbg_ptr)!==0}sheet_cursor_resource_usage(){let e=K.xlsxarchive_sheet_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw V(e[2]);var t=P(e[0],e[1]).slice();return K.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=K.xlsxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,V(i[2]);return e=n,t=r,I(n,r)}finally{K.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(M.prototype[Symbol.dispose]=M.prototype.free);function Pe(){return{__proto__:null,\"./xlsx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(I(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(I(e,t))}finally{K.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=B(n,K.__wbindgen_malloc,K.__wbindgen_realloc),i=G;Fe().setInt32(e+4,i,!0),Fe().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return I(e,t)},__wbindgen_init_externref_table:function(){let e=K.__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=>K.__wbg_xlsxarchive_free(e>>>0,1));function P(e,t){return e>>>=0,R().subarray(e/1,e/1+t)}let F=null;function Fe(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==K.memory.buffer)&&(F=new DataView(K.memory.buffer)),F}function I(e,t){return e>>>=0,Le(e,t)}let L=null;function R(){return(L===null||L.byteLength===0)&&(L=new Uint8Array(K.memory.buffer)),L}function z(e){return e==null}function Ie(e,t){let n=t(e.length*1,1)>>>0;return R().set(e,n/1),G=e.length,n}function B(e,t,n){if(n===void 0){let n=W.encode(e),r=t(n.length,1)>>>0;return R().subarray(r,r+n.length).set(n),G=n.length,r}let r=e.length,i=t(r,1)>>>0,a=R(),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=R().subarray(i+o,i+r),a=W.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return G=o,i}function V(e){let t=K.__wbindgen_externrefs.get(e);return K.__externref_table_dealloc(e),t}let H=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});H.decode();let U=0;function Le(e,t){return U+=t,U>=2146435072&&(H=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),H.decode(),U=t),H.decode(R().subarray(e,e+t))}const W=new TextEncoder;`encodeInto`in W||(W.encodeInto=function(e,t){let n=W.encode(e);return t.set(n),{read:e.length,written:n.length}});let G=0,K;function Re(e,t){return K=e.exports,F=null,L=null,K.__wbindgen_start(),K}async function ze(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 Be(e){if(K!==void 0)return K;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 t=Pe();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await ze(await e,t);return Re(n,r)}async function Ve(e){return K=void 0,F=null,L=null,Be(e)}function He(e,t){return{workbook:e(),usage:g(t())}}function Ue(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}const We=new Set([`outline`,`merge`,`conditional-format`,`ancillary-content`,`metadata-unavailable`,`unordered-rows`]);function Ge(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&&Ue(o.rows,n),r?.(o.rows),{kind:`rows`,rows:o.rows}}if(o.kind===`preview`){if(!Number.isSafeInteger(o.maxRow)||!Number.isSafeInteger(o.maxCol)||o.maxRow<0||o.maxCol<0||o.worksheet===null==(o.reason===null)||o.worksheet!==null&&(typeof o.worksheet!=`object`||Array.isArray(o.worksheet))||o.reason!==null&&!We.has(o.reason))throw Error(`worksheet preview unit is invalid`);return o.worksheet&&(o.worksheet.rows=[]),o}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`)}const Ke=new WeakMap;function qe(e,t){Ke.set(e,t)}function q(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function J(e,t,n){return q(e,`resource measurement`),q(t,`resource measurement`),q(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function Je(e,t=2**53-1){q(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=J(n,a,t),n>t)return n}return n}function Ye(e,t=2**53-1){q(t,`resource measurement limit`);let n=J(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=J(n,a,t),n>t)return n}return n}function Y(e,t){return J(0,e,t)}function X(e,t=2**53-1,n=!1){if(q(t,`resource measurement limit`),e===null)return{jsonBytes:Y(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:Ye(e,t),stringValueUtf8Bytes:Je(e,t)};if(typeof e==`boolean`)return{jsonBytes:Y(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:Y((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=Y(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=J(n,1,t));let a=X(e[i],t,!0);n=J(n,a.jsonBytes,t),r=J(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=Y(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=J(n,1,t)),n=J(n,Ye(a,t),t),n=J(n,1,t);let e=X(o,t);n=J(n,e.jsonBytes,t),r=J(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?Y(4,t):0,stringValueUtf8Bytes:0}}i();const Xe=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function Ze(e,t=A){let{maxCells:n,maxOwnedUtf8Bytes:r}=t.worksheet,i=e.reduce((e,t)=>J(e,t.cells.length,n),0);return{rows:e.length,cells:i,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=X(t.value,r).stringValueUtf8Bytes;return J(e,J(n,t.formula===void 0?0:Je(t.formula,r),r),r)},e),0)}}function Qe(e,t,n=A){let r=X(e,n.worksheet.maxJsonBytes);return{...t,jsonBytes:r.jsonBytes}}function $e(e,t,n=A){let r=n.worksheet;return{rows:J(e.rows,t.rows,r.maxRows),cells:J(e.cells,t.cells,r.maxCells),ownedUtf8Bytes:J(e.ownedUtf8Bytes,t.ownedUtf8Bytes,r.maxOwnedUtf8Bytes)}}function et(e,t,n,i,a,o,s,c=n!==`delimited-text-source`){let l=n===`worksheet-json`?`serialization`:`parsing`;return new r(x({stage:l,violation:{part:t,resource:n,metric:i,observed:o,limit:a}}),{stage:l,violation:{format:`xlsx`,operation:e,resource:n,metric:i,...t===void 0?{}:{part:t},limit:a,observed:Math.min(o,a+1),configurable:c,usage:s??Xe}})}function tt(e,t,n,r,i=A){let a=i.worksheet,o=[[`rows`,e.rows,a.maxRows],[`cells`,e.cells,a.maxCells],[`owned-utf8-bytes`,e.ownedUtf8Bytes,a.maxOwnedUtf8Bytes]];for(let[e,i,a]of o)if(i>a)throw et(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,a,i,r)}function nt(e,t,n,r,i=A){let a=i.worksheet.maxJsonBytes;if(e>a)throw et(t,n,`worksheet-json`,`bytes`,a,e,r)}i();var rt=class{archive;acceptWorksheet;executeArchive;prepareRows;provisional;worksheetPolicy;coordinator=new Ae;sessions=new Map;operationTail=Promise.resolve();pendingOpens=new Map;resourceFailure;constructor(e,t,n=e=>e(this.requireArchive()),r,i,a=()=>A){this.archive=e,this.acceptWorksheet=t,this.executeArchive=n,this.prepareRows=r,this.provisional=i,this.worksheetPolicy=a}reserveOpen(e){this.pendingOpens.set(e.sessionId,{identity:e,canceled:!1})}abandonOpen(e){this.pendingOpens.delete(e)}get pendingOpenCount(){return this.pendingOpens.size}runDuringPull(e){return this.sessions.size===0?this.run(e):this.coordinator.enqueue(async()=>{if(this.resourceFailure)throw this.resourceFailure;try{return e()}catch(e){throw e instanceof r&&(this.resourceFailure??=e),e}})}async open(e,t,n){if(this.resourceFailure)throw this.resourceFailure;let i=this.pendingOpens.get(n.sessionId);if(!i||i.identity.operationId!==n.operationId||i.identity.generation!==n.generation)throw Error(`worksheet pull session open reservation is stale or missing`);let a=this.worksheetPolicy(),o,s=new Promise(e=>{o=e}),c=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(i.canceled)throw Error(`worksheet pull session open was canceled`);this.executeArchive(n=>n.open_sheet_cursor(e,t));let s=[],c={rows:0,cells:0,ownedUtf8Bytes:0},l,u=!1,d=new je({...n,maxByteCredit:67108864,coordinator:this.coordinator,driver:{pull:()=>{let t=this.executeArchive(e=>e.pull_sheet_cursor(128)),n=this.executeArchive(e=>e.sheet_cursor_pull_finished());if(this.acceptWorksheet){let i=Ge(t,n,void 0,this.prepareRows);try{if(i.kind===`preview`)i.worksheet&&(i.worksheet.rows=s,qe(i.worksheet,a),this.provisional?.preview(e,i.worksheet));else if(i.kind===`rows`){let e=$e(c,Ze(i.rows,a),a);tt(e,`get-worksheet-worker`,void 0,this.readResourceUsage(),a),s.push(...i.rows),c=e}else i.kind===`finished`&&(l=i.worksheet)}catch(e){throw e instanceof r&&(this.resourceFailure??=e),e}}u=n;let i=De(t);return{payload:i,byteLength:i.byteLength,done:n,transfer:[i]}},measureChunk:({payload:e})=>e.byteLength,acknowledge:()=>{if(!u)return;let t,i;try{if(this.acceptWorksheet){if(!l)throw Error(`worksheet terminal payload is missing`);l.rows=l.parseError?[]:s;let n=l.parseError?{rows:0,cells:0,ownedUtf8Bytes:0}:c,r=Qe(l,n,a),o=this.readResourceUsage();tt(r,`get-worksheet-worker`,void 0,o,a),nt(r.jsonBytes,`get-worksheet-worker`,void 0,o,a),qe(l,a);let u=this.acceptWorksheet(e,l,r,o);typeof u==`function`?t=u:u&&({rollback:t,commit:i}=u)}this.executeArchive(e=>e.acknowledge_sheet_cursor_terminal()),i?.()}catch(e){throw t?.(),e instanceof r&&(this.resourceFailure??=e),e}u=!1,this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()},cancel:()=>{try{this.archive()&&this.executeArchive(e=>e.cancel_sheet_cursor())}finally{this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()}},close:()=>{try{this.archive()&&this.executeArchive(e=>e.close_sheet_cursor())}finally{this.sessions.delete(n.sessionId),this.provisional?.stop(e),o()}},resourceUsage:()=>this.readResourceUsage()}});this.sessions.set(n.sessionId,{host:d,identity:n}),this.pendingOpens.delete(n.sessionId)}));this.operationTail=c.then(()=>s,()=>void 0);try{await c}catch(e){throw this.pendingOpens.delete(n.sessionId),o(),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:E,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}:{protocol:E,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:E,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}),Promise.resolve()):(t({protocol:E,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:w(Error(`worksheet pull session is not open`))}),Promise.resolve())}async dispatchSafely(e,t){try{await this.dispatch(e,t)}catch(n){try{t({protocol:E,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:w(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 r&&(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:E,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:E,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(){return g(this.executeArchive(e=>e.sheet_cursor_resource_usage()))}};function it(e){return!!e&&typeof e==`object`&&e.protocol===`ooxml-pull-v1`}const Z=new Te(Be,{freeArchive:e=>e.free(),reinit:Ve});let Q=A;const $=new rt(()=>Z.archive,void 0,e=>{let t=Z.archive;if(!t)throw Error(`Workbook not loaded`);return Z.run(()=>e(t))},void 0,void 0,()=>Q);self.onmessage=async e=>{let n=e.data;if(it(n)){await $.dispatchSafely(n,(e,t)=>self.postMessage(e,t));return}if(n.type===`init`){Z.setWasmInput(t(n.wasmUrl)??n.wasmUrl);return}let r=n.id;n.type===`openSheetSession`&&$.reserveOpen(n);try{let e=n.type===`parse`?Me({xlsxWorksheetLimits:n.worksheetPolicy?.worksheet}):void 0;if(n.type===`openSheetSession`){await Z.ensureReady(),Z.archive&&Z.run(()=>Z.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,...w(e)}));return}n.type===`parse`&&await $.reset(),await(n.type===`extractImage`?$.runDuringPull:$.run).call($,async()=>{if(await Z.ensureReady(),n.type!==`parse`&&Z.archive){let e=Z.archive;Z.run(()=>e.assert_healthy())}if(n.type===`parse`){let[t,i,a]=Oe(n.resourcePolicy),o=new Uint8Array(n.data);Q=e??A;let s=Ne(Q),{workbook:c,usage:l}=He(()=>Z.run(()=>{let e=new M(o,t,i,a);return Z.setArchive(e),e.set_worksheet_limits(...s),e.parse()}),()=>Z.run(()=>Z.archive.resource_usage())),u=c.buffer,d={type:`parsed`,id:r,workbookJson:u,usage:l};self.postMessage(d,[u]);return}let t=Z.archive;if(n.type===`extractImage`){if(!t)throw Error(`No xlsx loaded`);let e=Z.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=Z.run(()=>g(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:Z.run(()=>t.to_markdown())};self.postMessage(e);return}})}catch(e){n.type===`openSheetSession`&&$.abandonOpen(n.sessionId);let t={type:`error`,id:r,...w(e)};try{self.postMessage(t)}catch{}}};", Zt = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Xt], { type: "text/javascript;charset=utf-8" });
|
|
15
|
+
function Qt(e) {
|
|
16
16
|
let t;
|
|
17
17
|
try {
|
|
18
|
-
if (t =
|
|
18
|
+
if (t = Zt && (self.URL || self.webkitURL).createObjectURL(Zt), !t) throw "";
|
|
19
19
|
let n = new Worker(t, {
|
|
20
20
|
type: "module",
|
|
21
21
|
name: e?.name
|
|
@@ -24,27 +24,27 @@ function nn(e) {
|
|
|
24
24
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
25
25
|
}), n;
|
|
26
26
|
} catch {
|
|
27
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
27
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Xt), {
|
|
28
28
|
type: "module",
|
|
29
29
|
name: e?.name
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
var
|
|
34
|
-
function
|
|
33
|
+
var $t = new URL("xlsx_parser_bg.wasm", import.meta.url).href;
|
|
34
|
+
function en(e, t) {
|
|
35
35
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? "visible" : e[t].visibility ?? "visible";
|
|
36
36
|
}
|
|
37
|
-
var
|
|
38
|
-
function
|
|
37
|
+
var tn = Symbol("xlsx-render-commit-guard");
|
|
38
|
+
function nn(e, t) {
|
|
39
39
|
return {
|
|
40
40
|
...e,
|
|
41
|
-
[
|
|
41
|
+
[tn]: t
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function rn(e, t) {
|
|
45
45
|
return e === void 0 ? t : t === void 0 ? e : Math.max(e, t);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function an(e, t) {
|
|
48
48
|
if (!e && !t) return null;
|
|
49
49
|
let n = e ? 1 - e.l - e.r : 1, r = (t ? 1 - t.l - t.r : 1) < n ? t : e, i = e ? 1 - e.t - e.b : 1, a = (t ? 1 - t.t - t.b : 1) < i ? t : e;
|
|
50
50
|
return {
|
|
@@ -54,55 +54,55 @@ function cn(e, t) {
|
|
|
54
54
|
b: a?.b ?? 0
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function on(e, t) {
|
|
58
58
|
return e ? t ? e === t ? e : void 0 : e : t;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function sn(e, t) {
|
|
61
61
|
return {
|
|
62
62
|
...e,
|
|
63
|
-
svgImagePath:
|
|
64
|
-
widthPt:
|
|
65
|
-
heightPt:
|
|
66
|
-
srcRect:
|
|
63
|
+
svgImagePath: on(e.svgImagePath, t.svgImagePath),
|
|
64
|
+
widthPt: rn(e.widthPt, t.widthPt),
|
|
65
|
+
heightPt: rn(e.heightPt, t.heightPt),
|
|
66
|
+
srcRect: an(e.srcRect, t.srcRect),
|
|
67
67
|
failClosedOnDuotoneFailure: e.failClosedOnDuotoneFailure || t.failClosedOnDuotoneFailure || void 0,
|
|
68
|
-
targetWidthPx:
|
|
69
|
-
targetHeightPx:
|
|
68
|
+
targetWidthPx: rn(e.targetWidthPx, t.targetWidthPx),
|
|
69
|
+
targetHeightPx: rn(e.targetHeightPx, t.targetHeightPx)
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function cn(e, t, n) {
|
|
73
73
|
let r = e.get(t);
|
|
74
|
-
e.set(t, r ?
|
|
74
|
+
e.set(t, r ? sn(r, n) : n);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
let { col: i, row: a } = (n ??
|
|
76
|
+
function ln(e, t, n, r) {
|
|
77
|
+
let { col: i, row: a } = (n ?? H(t)).axesAtScale(r), o = Ie(t, e, i, a, r);
|
|
78
78
|
return o.width > 0 && o.height > 0 ? {
|
|
79
79
|
width: o.width,
|
|
80
80
|
height: o.height
|
|
81
81
|
} : null;
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var un = {
|
|
84
84
|
x: 0,
|
|
85
85
|
y: 0
|
|
86
86
|
};
|
|
87
|
-
function
|
|
88
|
-
if (!e?.length) return
|
|
89
|
-
let a =
|
|
90
|
-
return a === null ? null : a.x === 0 && a.y === 0 ?
|
|
87
|
+
function dn(e, t, n, r, i) {
|
|
88
|
+
if (!e?.length) return un;
|
|
89
|
+
let a = re(e, t, n);
|
|
90
|
+
return a === null ? null : a.x === 0 && a.y === 0 ? un : r > 0 && i > 0 ? {
|
|
91
91
|
x: a.x / r,
|
|
92
92
|
y: a.y / i
|
|
93
93
|
} : null;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function fn(e, t) {
|
|
96
96
|
return e === null || t === null ? null : {
|
|
97
97
|
x: Math.max(e.x, t.x),
|
|
98
98
|
y: Math.max(e.y, t.y)
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
if (!n || a === null) return e.anchorTag === void 0 ||
|
|
103
|
-
let o = r ??
|
|
101
|
+
function pn(e, t, n, r, i, a = un) {
|
|
102
|
+
if (!n || a === null) return e.anchorTag === void 0 || ln(e, t, r, i?.scale ?? 1) !== null;
|
|
103
|
+
let o = r ?? H(t), s = i?.scale ?? 1, { col: c, row: l } = o.axesAtScale(s), u = Ie(t, e, c, l, s);
|
|
104
104
|
if (u.width <= 0 || u.height <= 0) return !1;
|
|
105
|
-
let d = u.width * a.x, f = u.height * a.y, p =
|
|
105
|
+
let d = u.width * a.x, f = u.height * a.y, p = Re({
|
|
106
106
|
x: u.x - d,
|
|
107
107
|
y: u.y - f,
|
|
108
108
|
width: u.width + 2 * d,
|
|
@@ -124,19 +124,19 @@ function mn(e, t, n, r, i, a = K) {
|
|
|
124
124
|
};
|
|
125
125
|
return h(p.x, p.x + p.width, c.offsetOf(m.cols + 1), c.offsetOf(n.col), c.offsetOf(n.col + n.cols)) && h(p.y, p.y + p.height, l.offsetOf(m.rows + 1), l.offsetOf(n.row), l.offsetOf(n.row + n.rows));
|
|
126
126
|
}
|
|
127
|
-
async function
|
|
127
|
+
async function mn(e, t, r, i, a = 0, o = 0, s = null, c = null, l, u = !1, d, f, p, m) {
|
|
128
128
|
let h = t === "image/svg+xml", v = c && "effects" in c ? s && !n(s) ? null : {
|
|
129
129
|
widthPt: a,
|
|
130
130
|
heightPt: o
|
|
131
131
|
} : _(t, s, a, o);
|
|
132
132
|
if (!v) return null;
|
|
133
|
-
let y = () =>
|
|
133
|
+
let y = () => ee(e, t, c, i, {
|
|
134
134
|
widthPt: v.widthPt,
|
|
135
135
|
heightPt: v.heightPt,
|
|
136
136
|
offscreenFactory: l,
|
|
137
137
|
failClosedOnDuotoneFailure: u,
|
|
138
138
|
tiff: d,
|
|
139
|
-
svgDecoder: p ?? (typeof Image < "u" ?
|
|
139
|
+
svgDecoder: p ?? (typeof Image < "u" ? M : void 0),
|
|
140
140
|
...f ?? {},
|
|
141
141
|
...m ? { maxRetainedPixels: m } : {}
|
|
142
142
|
}), b = {
|
|
@@ -144,28 +144,28 @@ async function hn(e, t, r, i, a = 0, o = 0, s = null, c = null, l, u = !1, d, f,
|
|
|
144
144
|
srcRect: s
|
|
145
145
|
};
|
|
146
146
|
if (!c && j(b)) try {
|
|
147
|
-
return await
|
|
147
|
+
return await L(b.svgImagePath, i, {
|
|
148
148
|
...f,
|
|
149
149
|
maxRetainedPixels: m,
|
|
150
150
|
workerDecoder: p
|
|
151
151
|
});
|
|
152
152
|
} catch (t) {
|
|
153
|
-
if (t instanceof g ||
|
|
154
|
-
return h ?
|
|
153
|
+
if (t instanceof g || R(t)) throw t;
|
|
154
|
+
return h ? L(e, i, {
|
|
155
155
|
...f,
|
|
156
156
|
maxRetainedPixels: m,
|
|
157
157
|
workerDecoder: p
|
|
158
158
|
}) : y();
|
|
159
159
|
}
|
|
160
|
-
return h && c ? y() : h ?
|
|
160
|
+
return h && c ? y() : h ? L(e, i, {
|
|
161
161
|
...f,
|
|
162
162
|
maxRetainedPixels: m,
|
|
163
163
|
workerDecoder: p
|
|
164
164
|
}) : y();
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
167
|
-
if (n.clear(),
|
|
168
|
-
let v = s, y = /* @__PURE__ */ new Map(), b = _?.viewport ?
|
|
166
|
+
async function hn(e, n, s, _) {
|
|
167
|
+
if (n.clear(), vt(n), !s) return;
|
|
168
|
+
let v = s, y = /* @__PURE__ */ new Map(), b = _?.viewport ? H(e) : void 0, x = _?.viewport && _.width !== void 0 && _.height !== void 0 ? {
|
|
169
169
|
width: _.width,
|
|
170
170
|
height: _.height,
|
|
171
171
|
scale: _.cellScale ?? 1,
|
|
@@ -173,9 +173,9 @@ async function gn(e, n, s, _) {
|
|
|
173
173
|
freezeCols: _.freezeCols ?? e.freezeCols ?? 0
|
|
174
174
|
} : void 0;
|
|
175
175
|
if (e.images) for (let t of e.images) {
|
|
176
|
-
if (!
|
|
177
|
-
let n =
|
|
178
|
-
|
|
176
|
+
if (!pn(t, e, _?.viewport, b, x, ((e) => dn(t.blipEffects, e.cx, e.cy, e.cx, e.cy))(gt(t)))) continue;
|
|
177
|
+
let n = ln(t, e, b, _?.cellScale ?? 1), i = gt(t), s = rt(t, i), c = t.blipEffects?.length ? ot(i) : null;
|
|
178
|
+
cn(y, nt(t.imagePath, s, i), {
|
|
179
179
|
imagePath: t.imagePath,
|
|
180
180
|
mimeType: t.mimeType,
|
|
181
181
|
svgImagePath: t.svgImagePath,
|
|
@@ -193,10 +193,10 @@ async function gn(e, n, s, _) {
|
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
if (e.shapeGroups) {
|
|
196
|
-
for (let t of e.shapeGroups) if (
|
|
196
|
+
for (let t of e.shapeGroups) if (pn(t, e, _?.viewport, b, x, t.shapes.reduce((e, n) => n.geom?.type === "image" ? fn(e, dn(n.geom.blipEffects, t.nativeExtCx * n.w, t.nativeExtCy * n.h, t.nativeExtCx, t.nativeExtCy)) : e, un))) {
|
|
197
197
|
for (let n of t.shapes) if (n.geom.type === "image") {
|
|
198
|
-
let i =
|
|
199
|
-
|
|
198
|
+
let i = ln(t, e, b, _?.cellScale ?? 1), s = tt(t, n), c = rt(n.geom, s), l = n.geom.blipEffects?.length ? ot(s) : null;
|
|
199
|
+
cn(y, nt(n.geom.imagePath, c, s), {
|
|
200
200
|
imagePath: n.geom.imagePath,
|
|
201
201
|
mimeType: n.geom.mimeType,
|
|
202
202
|
svgImagePath: n.geom.svgImagePath,
|
|
@@ -215,10 +215,10 @@ async function gn(e, n, s, _) {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
let S = e.charts ?? [], C = S.length > 0 ? b ??
|
|
218
|
+
let S = e.charts ?? [], C = S.length > 0 ? b ?? H(e) : b, w = [];
|
|
219
219
|
for (let t of S) {
|
|
220
|
-
if (!
|
|
221
|
-
let n =
|
|
220
|
+
if (!pn(t, e, _?.viewport, C, x)) continue;
|
|
221
|
+
let n = ln(t, e, C, _?.cellScale ?? 1);
|
|
222
222
|
if (!n || !Number.isFinite(n.width) || !Number.isFinite(n.height) || n.width <= 0 || n.height <= 0) continue;
|
|
223
223
|
let i = f(t.chart), o = {
|
|
224
224
|
widthPt: n.width * (r / a),
|
|
@@ -260,7 +260,7 @@ async function gn(e, n, s, _) {
|
|
|
260
260
|
}
|
|
261
261
|
let D = new Set(T.map(({ fill: e }) => c(e))), O = (e) => {
|
|
262
262
|
let t = [], n = _?.cellScale ?? 1;
|
|
263
|
-
for (let r of w) for (let { fill: a, occurrence: o } of
|
|
263
|
+
for (let r of w) for (let { fill: a, occurrence: o } of fe(r.chart.chart, {
|
|
264
264
|
x: 0,
|
|
265
265
|
y: 0,
|
|
266
266
|
w: r.displayWidth / n,
|
|
@@ -277,7 +277,7 @@ async function gn(e, n, s, _) {
|
|
|
277
277
|
renderedSize: o
|
|
278
278
|
}), t.push(e));
|
|
279
279
|
}
|
|
280
|
-
return
|
|
280
|
+
return pe(E.size), t;
|
|
281
281
|
};
|
|
282
282
|
O();
|
|
283
283
|
for (let e of w) for (let { usage: t, size: n } of e.usages) {
|
|
@@ -296,9 +296,9 @@ async function gn(e, n, s, _) {
|
|
|
296
296
|
hasSourceCrop: i.hasSourceCrop || t.hasSourceCrop
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
let
|
|
299
|
+
let A = (e, t) => {
|
|
300
300
|
let { fill: n, widthPt: r, heightPt: i, targetWidthPx: a, targetHeightPx: o, hasSourceCrop: s, renderedSize: c } = t;
|
|
301
|
-
|
|
301
|
+
cn(y, e, {
|
|
302
302
|
imagePath: n.imagePath,
|
|
303
303
|
mimeType: n.mimeType,
|
|
304
304
|
svgImagePath: n.svgImagePath,
|
|
@@ -318,24 +318,24 @@ async function gn(e, n, s, _) {
|
|
|
318
318
|
} : {}
|
|
319
319
|
});
|
|
320
320
|
};
|
|
321
|
-
for (let [e, t] of E)
|
|
321
|
+
for (let [e, t] of E) A(e, t);
|
|
322
322
|
if (y.size === 0) return;
|
|
323
|
-
let
|
|
323
|
+
let M = oe(_?.imageResources), N = k((await Promise.all([...y].map(async ([e, t]) => {
|
|
324
324
|
if (!t.targetWidthPx || !t.targetHeightPx || t.mimeType === "image/svg+xml" || t.duotone || !t.duotone && j({
|
|
325
325
|
svgImagePath: t.svgImagePath,
|
|
326
326
|
srcRect: t.srcRect
|
|
327
327
|
})) return null;
|
|
328
|
-
if (
|
|
328
|
+
if (le(t.mimeType) && (M.resolution === "display" || M.strategy === "adaptive")) return {
|
|
329
329
|
key: e,
|
|
330
330
|
targetWidthPx: t.targetWidthPx,
|
|
331
331
|
targetHeightPx: t.targetHeightPx,
|
|
332
332
|
retainedSurfaceCount: 1
|
|
333
333
|
};
|
|
334
|
-
let n = await
|
|
335
|
-
if (e instanceof g ||
|
|
334
|
+
let n = await F(t.imagePath, t.mimeType, v).catch((e) => {
|
|
335
|
+
if (e instanceof g || R(e)) throw e;
|
|
336
336
|
return null;
|
|
337
337
|
});
|
|
338
|
-
return !n?.dimensions || !
|
|
338
|
+
return !n?.dimensions || !ue(n.format, _?.tiff !== void 0) ? null : {
|
|
339
339
|
key: e,
|
|
340
340
|
targetWidthPx: t.targetWidthPx,
|
|
341
341
|
targetHeightPx: t.targetHeightPx,
|
|
@@ -343,65 +343,65 @@ async function gn(e, n, s, _) {
|
|
|
343
343
|
sourceHeightPx: n.dimensions.height,
|
|
344
344
|
retainedSurfaceCount: 1
|
|
345
345
|
};
|
|
346
|
-
}))).filter((e) => e !== null),
|
|
346
|
+
}))).filter((e) => e !== null), M);
|
|
347
347
|
for (let [e, t] of y) {
|
|
348
348
|
if (t.mimeType === "image/svg+xml" || !t.duotone && j({
|
|
349
349
|
svgImagePath: t.svgImagePath,
|
|
350
350
|
srcRect: t.srcRect
|
|
351
351
|
})) continue;
|
|
352
|
-
let n =
|
|
352
|
+
let n = N.targets.get(e);
|
|
353
353
|
t.targetWidthPx = n?.width, t.targetHeightPx = n?.height, t.plannedPixelLimit = n?.maxRetainedPixels;
|
|
354
354
|
}
|
|
355
|
-
let
|
|
355
|
+
let P = async ([e, r]) => {
|
|
356
356
|
try {
|
|
357
|
-
let t = await
|
|
357
|
+
let t = await mn(r.imagePath, r.mimeType, r.svgImagePath, v, r.widthPt, r.heightPt, r.srcRect, r.duotone, _?.offscreenFactory, r.failClosedOnDuotoneFailure ?? !1, _?.tiff, r.targetWidthPx && r.targetHeightPx ? {
|
|
358
358
|
targetWidthPx: r.targetWidthPx,
|
|
359
359
|
targetHeightPx: r.targetHeightPx
|
|
360
360
|
} : void 0, _?.svgDecoder, r.plannedPixelLimit);
|
|
361
361
|
n.set(e, t);
|
|
362
362
|
} catch (r) {
|
|
363
|
-
if (
|
|
364
|
-
n.set(e, null),
|
|
363
|
+
if (de(r, "tiff") || me(r)) {
|
|
364
|
+
n.set(e, null), Ze(n, e, "tiff");
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
if (r instanceof g ||
|
|
367
|
+
if (r instanceof g || R(r) || r instanceof t && r.code === "unsupported-image-effect") throw r;
|
|
368
368
|
n.delete(e);
|
|
369
369
|
}
|
|
370
370
|
};
|
|
371
|
-
for (await Promise.all([...y.entries()].map(
|
|
371
|
+
for (await Promise.all([...y.entries()].map(P));;) {
|
|
372
372
|
let e = O(h(n, void 0, !1));
|
|
373
373
|
if (e.length === 0) break;
|
|
374
|
-
for (let t of e)
|
|
375
|
-
await Promise.all(e.map((e) =>
|
|
374
|
+
for (let t of e) A(t, E.get(t));
|
|
375
|
+
await Promise.all(e.map((e) => P([e, y.get(e)])));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
var
|
|
379
|
-
function
|
|
380
|
-
if (
|
|
381
|
-
let i =
|
|
382
|
-
if (a && a.sourceGeometry === i &&
|
|
378
|
+
var gn = /* @__PURE__ */ new WeakMap();
|
|
379
|
+
function _n(e, t, n, r) {
|
|
380
|
+
if (lt(t)) return t;
|
|
381
|
+
let i = H(t), a = gn.get(t);
|
|
382
|
+
if (a && a.sourceGeometry === i && Ct(a.projection) === Ct(t)) return a.projection;
|
|
383
383
|
let o = {
|
|
384
384
|
...t,
|
|
385
385
|
rowHeights: { ...t.rowHeights }
|
|
386
386
|
};
|
|
387
|
-
|
|
387
|
+
qt(t, o), pt(t, o);
|
|
388
388
|
let s = i.maximumDigitWidth;
|
|
389
|
-
return
|
|
389
|
+
return q.forWorksheet(o, s), ht(e, o, n, r), q.forWorksheet(o, s), gn.set(t, {
|
|
390
390
|
projection: o,
|
|
391
391
|
sourceGeometry: i
|
|
392
392
|
}), o;
|
|
393
393
|
}
|
|
394
|
-
async function
|
|
395
|
-
let a = () =>
|
|
396
|
-
return r.fetchImage && o ?
|
|
394
|
+
async function vn(e, t, n, r = {}, i) {
|
|
395
|
+
let a = () => yn(e, t, n, r, i), o = !e.ws.isDialogSheet && ((e.ws.images?.length ?? 0) > 0 || (e.ws.shapeGroups?.some((e) => e.shapes.some((e) => e.geom.type === "image")) ?? !1) || d((e.ws.charts ?? []).map((e) => e.chart)).length > 0);
|
|
396
|
+
return r.fetchImage && o ? se(r.fetchImage, r.imageResources, a) : a();
|
|
397
397
|
}
|
|
398
|
-
async function
|
|
399
|
-
if (r[
|
|
398
|
+
async function yn(e, t, n, r = {}, i) {
|
|
399
|
+
if (r[tn]?.() === !1) return;
|
|
400
400
|
let a = e.styles, o = t.getContext("2d");
|
|
401
401
|
if (!o) throw Error("XLSX render target does not provide a 2-D canvas context");
|
|
402
|
-
|
|
403
|
-
let c = e.ws.isDialogSheet ? e.ws :
|
|
404
|
-
if (c.isDialogSheet || await
|
|
402
|
+
dt(o, e.ws, r.officeFontRoutes, r.googleSubstitutes === !0), it(e.ws, r.authoritativeMdw);
|
|
403
|
+
let c = e.ws.isDialogSheet ? e.ws : _n(o, e.ws, a, e.cjkFallback), l = b(t) ? t.clientWidth || 800 : t.width, u = b(t) ? t.clientHeight || 600 : t.height, d = r.width ?? l, f = r.height ?? u, p = r.dpr ?? D(), m = s(d * p, f * p), h = m.clamped ? p * m.scale : p, g = /* @__PURE__ */ new Map();
|
|
404
|
+
if (c.isDialogSheet || await hn(c, g, r.fetchImage, {
|
|
405
405
|
viewport: n,
|
|
406
406
|
width: d,
|
|
407
407
|
height: f,
|
|
@@ -415,7 +415,7 @@ async function bn(e, t, n, r = {}, i) {
|
|
|
415
415
|
threeD: e.threeD,
|
|
416
416
|
regionMap: e.regionMap,
|
|
417
417
|
chartEx: e.chartEx
|
|
418
|
-
}), !c.isDialogSheet && e.math &&
|
|
418
|
+
}), !c.isDialogSheet && e.math && yt(c) && await et(c, e.math), r[tn]?.() === !1) return;
|
|
419
419
|
let _ = m.width, v = m.height;
|
|
420
420
|
if (t.width !== _ && (t.width = _), t.height !== v && (t.height = v), b(t)) {
|
|
421
421
|
let e = `${d}px`, n = `${f}px`;
|
|
@@ -423,14 +423,14 @@ async function bn(e, t, n, r = {}, i) {
|
|
|
423
423
|
}
|
|
424
424
|
let y = t.getContext("2d");
|
|
425
425
|
if (y.setTransform(h, 0, 0, h, 0, 0), c.parseError) {
|
|
426
|
-
|
|
426
|
+
xn(y, d, f, c.name, c.parseError);
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
429
|
if (c.isDialogSheet) {
|
|
430
|
-
|
|
430
|
+
bn(y, d, f);
|
|
431
431
|
return;
|
|
432
432
|
}
|
|
433
|
-
|
|
433
|
+
_t(y, c, a, n, {
|
|
434
434
|
...r,
|
|
435
435
|
dpr: h,
|
|
436
436
|
loadedImages: g,
|
|
@@ -439,12 +439,12 @@ async function bn(e, t, n, r = {}, i) {
|
|
|
439
439
|
chartEx: e.chartEx
|
|
440
440
|
}, e.cjkFallback);
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function bn(e, t, n) {
|
|
443
443
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
444
444
|
let r = Math.min(t, n);
|
|
445
445
|
e.fillStyle = "#555555", e.textAlign = "center", e.textBaseline = "middle", e.font = `${Math.max(13, r * .035)}px sans-serif`, e.fillText("Legacy dialog sheets are not displayed", t / 2, n / 2), e.restore();
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function xn(e, t, n, r, i) {
|
|
448
448
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
449
449
|
let a = t / 2, o = Math.min(t, n), s = Math.max(20, o * .1);
|
|
450
450
|
e.fillStyle = "#b23b3b", e.textAlign = "center", e.textBaseline = "middle", e.font = `${s}px sans-serif`, e.fillText("⚠", a, n * .32);
|
|
@@ -462,7 +462,7 @@ function Sn(e, t, n, r, i) {
|
|
|
462
462
|
for (let t of f.slice(0, 4)) e.fillText(t, a, h), h += m;
|
|
463
463
|
e.restore();
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function Sn(e) {
|
|
466
466
|
let t = (e ?? "").trim();
|
|
467
467
|
if (!t) return {
|
|
468
468
|
kind: "unresolved",
|
|
@@ -477,9 +477,9 @@ function Cn(e) {
|
|
|
477
477
|
let e = t.slice(0, i);
|
|
478
478
|
e.startsWith("'") && e.endsWith("'") && e.length >= 2 && (e = e.slice(1, -1).replace(/''/g, "'")), n = e, r = t.slice(i + 1);
|
|
479
479
|
}
|
|
480
|
-
let [a, o] = r.split(":"), s =
|
|
480
|
+
let [a, o] = r.split(":"), s = z(a ?? "");
|
|
481
481
|
if (s) {
|
|
482
|
-
let e = o ?
|
|
482
|
+
let e = o ? z(o) : s;
|
|
483
483
|
if (e) {
|
|
484
484
|
let t = {
|
|
485
485
|
row: Math.min(s.row, e.row),
|
|
@@ -501,7 +501,7 @@ function Cn(e) {
|
|
|
501
501
|
formula: t
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function Cn(e, t) {
|
|
505
505
|
if (e.kind === "inline") return {
|
|
506
506
|
kind: "values",
|
|
507
507
|
values: e.values
|
|
@@ -520,7 +520,7 @@ function wn(e, t) {
|
|
|
520
520
|
values: n
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function wn(e) {
|
|
524
524
|
let { cell: t, panel: n, viewport: r, rtl: i } = e, a = t.y + t.h + 2, o = t.y - 2 - n.h, s;
|
|
525
525
|
s = a + n.h <= r.h ? a : o >= 0 ? o : a, s = Math.max(0, Math.min(s, r.h - n.h));
|
|
526
526
|
let c = i ? t.x + t.w - n.w : t.x;
|
|
@@ -529,7 +529,7 @@ function Tn(e) {
|
|
|
529
529
|
top: s
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Tn(e, t) {
|
|
533
533
|
let n = !1;
|
|
534
534
|
for (let [r, i] of Object.entries(t)) {
|
|
535
535
|
let t = Number(r);
|
|
@@ -537,43 +537,43 @@ function En(e, t) {
|
|
|
537
537
|
}
|
|
538
538
|
return n;
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function En(e, t) {
|
|
541
541
|
if (!t) return;
|
|
542
542
|
let n = !1;
|
|
543
|
-
if (t.rowHeightRanges && (
|
|
544
|
-
n &&
|
|
543
|
+
if (t.rowHeightRanges && (Yt(e, t.rowHeightRanges), n = !0), t.rows && (n = Tn(e.rowHeights, t.rows) || n), t.cols && (n = Tn(e.colWidths, t.cols) || n), t.columnCssWidths) for (let [r, i] of Object.entries(t.columnCssWidths)) W(e, Number(r), i) && (n = !0);
|
|
544
|
+
n && q.invalidate(e);
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
return t ?
|
|
546
|
+
function Dn(e, t) {
|
|
547
|
+
return t ? On(e, t) : e;
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function On(e, t) {
|
|
550
550
|
let n = { ...e };
|
|
551
|
-
return t && (n.rowHeights = { ...e.rowHeights }, n.colWidths = { ...e.colWidths }),
|
|
551
|
+
return t && (n.rowHeights = { ...e.rowHeights }, n.colWidths = { ...e.colWidths }), B(e, n), U(e, n), qt(e, n), En(n, t), n;
|
|
552
552
|
}
|
|
553
|
-
var
|
|
554
|
-
function
|
|
553
|
+
var kn = Symbol("xlsx-viewer-render-context");
|
|
554
|
+
function An(e, t, n) {
|
|
555
555
|
if (!Number.isFinite(t) || t <= 0) throw Error("XLSX maximum digit width must be a finite positive number");
|
|
556
556
|
return {
|
|
557
557
|
...e,
|
|
558
|
-
[
|
|
558
|
+
[kn]: {
|
|
559
559
|
maximumDigitWidth: t,
|
|
560
560
|
worksheet: n?.worksheet,
|
|
561
561
|
projection: n?.projection
|
|
562
562
|
}
|
|
563
563
|
};
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
let t = e[
|
|
567
|
-
return delete n[
|
|
565
|
+
function jn(e) {
|
|
566
|
+
let t = e[kn], n = { ...e };
|
|
567
|
+
return delete n[kn], t ? {
|
|
568
568
|
opts: n,
|
|
569
569
|
layoutMetrics: { maximumDigitWidth: t.maximumDigitWidth },
|
|
570
570
|
worksheet: t.worksheet,
|
|
571
571
|
projection: t.projection
|
|
572
572
|
} : { opts: n };
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
576
|
-
if (e >
|
|
574
|
+
var Mn = "load-delimited-text", J = Pt;
|
|
575
|
+
function Nn(e) {
|
|
576
|
+
if (e > J) throw At(Mn, void 0, "delimited-text-source", "bytes", J, e);
|
|
577
577
|
}
|
|
578
578
|
Object.freeze({
|
|
579
579
|
fonts: [Object.freeze({
|
|
@@ -608,7 +608,7 @@ Object.freeze({
|
|
|
608
608
|
numFmts: [],
|
|
609
609
|
dxfs: []
|
|
610
610
|
});
|
|
611
|
-
function
|
|
611
|
+
function Pn(e) {
|
|
612
612
|
if (!e || e.format !== "csv" && e.format !== "tsv" && e.format !== "delimited-text") throw TypeError("format must be 'csv', 'tsv', or 'delimited-text'");
|
|
613
613
|
let t = e.delimiter ?? (e.format === "tsv" ? " " : e.format === "csv" ? "," : void 0);
|
|
614
614
|
if (t === void 0) throw TypeError("delimiter is required for format 'delimited-text'");
|
|
@@ -624,11 +624,11 @@ function Fn(e) {
|
|
|
624
624
|
sheetName: r
|
|
625
625
|
});
|
|
626
626
|
}
|
|
627
|
-
async function
|
|
627
|
+
async function Fn(e) {
|
|
628
628
|
let t = e.headers.get("content-encoding")?.trim().toLowerCase(), n = e.headers.get("content-length");
|
|
629
629
|
if ((!t || t === "identity") && n !== null && /^\d+$/.test(n.trim())) {
|
|
630
630
|
let t = Number(n);
|
|
631
|
-
t >
|
|
631
|
+
t > J && (await e.body?.cancel().catch(() => void 0), Nn(t));
|
|
632
632
|
}
|
|
633
633
|
let r = e.body;
|
|
634
634
|
if (!r) return /* @__PURE__ */ new ArrayBuffer(0);
|
|
@@ -637,7 +637,7 @@ async function In(e) {
|
|
|
637
637
|
for (;;) {
|
|
638
638
|
let { done: e, value: t } = await i.read();
|
|
639
639
|
if (e) break;
|
|
640
|
-
!t || t.byteLength === 0 || (t.byteLength >
|
|
640
|
+
!t || t.byteLength === 0 || (t.byteLength > J - o && (await i.cancel().catch(() => void 0), Nn(J + 1)), a.push(t), o += t.byteLength);
|
|
641
641
|
}
|
|
642
642
|
} finally {
|
|
643
643
|
i.releaseLock();
|
|
@@ -646,7 +646,7 @@ async function In(e) {
|
|
|
646
646
|
for (let e of a) s.set(e, c), c += e.byteLength;
|
|
647
647
|
return s.buffer;
|
|
648
648
|
}
|
|
649
|
-
var
|
|
649
|
+
var In = class {
|
|
650
650
|
rows;
|
|
651
651
|
ready;
|
|
652
652
|
resolveReady;
|
|
@@ -695,19 +695,19 @@ var Ln = class {
|
|
|
695
695
|
this.waiters = [];
|
|
696
696
|
for (let t of e) this.complete || this.coveredThrough >= t.row ? t.resolve() : this.waiters.push(t);
|
|
697
697
|
}
|
|
698
|
-
},
|
|
698
|
+
}, Ln = /* @__PURE__ */ new WeakMap(), Rn = Object.freeze({
|
|
699
699
|
minRows: 50,
|
|
700
700
|
minCols: 26
|
|
701
701
|
});
|
|
702
|
-
function
|
|
703
|
-
|
|
702
|
+
function zn(e, t) {
|
|
703
|
+
Ln.set(e, t);
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
let n =
|
|
707
|
-
n &&
|
|
705
|
+
function Bn(e, t) {
|
|
706
|
+
let n = Ln.get(e);
|
|
707
|
+
n && Ln.set(t, n);
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
let n =
|
|
709
|
+
function Vn(e, t = {}) {
|
|
710
|
+
let n = Ln.get(e), r = Math.max(t.minRows ?? Rn.minRows, e.freezeRows ?? 0, n?.maxRow ?? 0), i = Math.max(t.minCols ?? Rn.minCols, e.freezeCols ?? 0, n?.maxCol ?? 0);
|
|
711
711
|
for (let t of e.rows) {
|
|
712
712
|
t.index > r && (r = t.index);
|
|
713
713
|
for (let e of t.cells) e.col > i && (i = e.col);
|
|
@@ -723,15 +723,15 @@ function Hn(e, t = {}) {
|
|
|
723
723
|
r = Math.max(r, t, n), i = Math.max(i, a, o);
|
|
724
724
|
}
|
|
725
725
|
return {
|
|
726
|
-
maxRow: Math.min(
|
|
727
|
-
maxCol: Math.min(
|
|
726
|
+
maxRow: Math.min(K, r),
|
|
727
|
+
maxCol: Math.min(G, i)
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
|
-
var
|
|
730
|
+
var Hn = Symbol("retain-xlsx-viewer-fonts"), Un = Symbol("prepare-xlsx-viewer-row-heights"), Wn = Symbol("release-xlsx-viewer-projection"), Gn = Symbol("load-xlsx-sheet-source"), Kn = Symbol("xlsx-cell-display-texts"), qn = class e {
|
|
731
731
|
metrics = null;
|
|
732
732
|
bridge = null;
|
|
733
733
|
delimitedTextBacked = !1;
|
|
734
|
-
japaneseCellFonts =
|
|
734
|
+
japaneseCellFonts = He();
|
|
735
735
|
parsedWorkbook = null;
|
|
736
736
|
sheetCache = /* @__PURE__ */ new Map();
|
|
737
737
|
sheetCacheUsage = /* @__PURE__ */ new Map();
|
|
@@ -739,13 +739,13 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
739
739
|
evictingSheets = /* @__PURE__ */ new Map();
|
|
740
740
|
sheetLoads = /* @__PURE__ */ new Map();
|
|
741
741
|
sheetPreviews = /* @__PURE__ */ new Map();
|
|
742
|
-
rawParts = new
|
|
742
|
+
rawParts = new ae({
|
|
743
743
|
maxEntries: 64,
|
|
744
|
-
maxBytes:
|
|
744
|
+
maxBytes: O
|
|
745
745
|
});
|
|
746
746
|
queuedImageLoads = /* @__PURE__ */ new Map();
|
|
747
747
|
_fetchImage = (e, t) => this.getImageWithinArchiveOperation(e, t);
|
|
748
|
-
worksheetPolicy =
|
|
748
|
+
worksheetPolicy = zt;
|
|
749
749
|
cjkFallback = "jp";
|
|
750
750
|
math;
|
|
751
751
|
threeD;
|
|
@@ -770,14 +770,14 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
770
770
|
};
|
|
771
771
|
resourceFailure = null;
|
|
772
772
|
constructor(e, t, n, r = !0) {
|
|
773
|
-
if (this._mode = t, e && (this.bridge = new
|
|
773
|
+
if (this._mode = t, e && (this.bridge = new ve(e, {
|
|
774
774
|
correlate: (e) => "protocol" in e && e.protocol === "ooxml-pull-v1" ? e.requestId : "id" in e ? e.id : void 0,
|
|
775
|
-
toError: (e) => "type" in e && e.type === "error" ?
|
|
775
|
+
toError: (e) => "type" in e && e.type === "error" ? A(e) : void 0,
|
|
776
776
|
onUnsolicited: (t) => {
|
|
777
|
-
|
|
777
|
+
Ne((t, n) => e.postMessage(t, n), t);
|
|
778
778
|
}
|
|
779
779
|
}), r)) {
|
|
780
|
-
let e = new URL(n ??
|
|
780
|
+
let e = new URL(n ?? $t, location.href).href;
|
|
781
781
|
this.bridge.post({
|
|
782
782
|
type: "init",
|
|
783
783
|
wasmUrl: e
|
|
@@ -787,21 +787,21 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
787
787
|
get mode() {
|
|
788
788
|
return this._mode;
|
|
789
789
|
}
|
|
790
|
-
static async [
|
|
790
|
+
static async [Gn](e, t, n = {}) {
|
|
791
791
|
if (n.format === void 0 || n.format === "xlsx") return await this.load(e, t);
|
|
792
792
|
if (n.format === "csv" || n.format === "tsv" || n.format === "delimited-text") return await this.loadDelimitedText(e, t, n);
|
|
793
793
|
throw TypeError("Unsupported XlsxSheetViewer source format");
|
|
794
794
|
}
|
|
795
795
|
static async loadDelimitedText(t, n, r) {
|
|
796
|
-
let i =
|
|
796
|
+
let i = Tt(n);
|
|
797
797
|
n = {
|
|
798
798
|
...n,
|
|
799
799
|
xlsxWorksheetLimits: i.worksheet
|
|
800
800
|
}, n = {
|
|
801
801
|
...n,
|
|
802
|
-
cjkFallback:
|
|
802
|
+
cjkFallback: N(n.cjkFallback)
|
|
803
803
|
};
|
|
804
|
-
let a =
|
|
804
|
+
let a = Pn(r), o = C(n), s = n.mode ?? "main", c = new T({
|
|
805
805
|
enabled: !0,
|
|
806
806
|
format: "xlsx",
|
|
807
807
|
mode: s,
|
|
@@ -816,32 +816,32 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
816
816
|
if (typeof t == "string") {
|
|
817
817
|
let e = await fetch(t);
|
|
818
818
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
819
|
-
i = await
|
|
819
|
+
i = await Fn(e);
|
|
820
820
|
} else i = t;
|
|
821
|
-
|
|
822
|
-
let o = s === "worker" ? (await import("./render-worker-host-
|
|
821
|
+
Nn(i.byteLength), c.setSourceBytes(i.byteLength), c.checkpoint("source ready");
|
|
822
|
+
let o = s === "worker" ? (await import("./render-worker-host-stI5Lppz.js")).createRenderWorker() : (await import("./delimited-text-worker-host-RwvuSsP2.js")).createDelimitedTextWorker(), l;
|
|
823
823
|
try {
|
|
824
824
|
let t = new e(o, s, void 0, !1);
|
|
825
825
|
return l = t, t.metrics = c, await t._loadDelimitedText(r === i ? i.slice(0) : i, n, a), s === "main" && (t.bridge?.terminate(), t.bridge = null), c.checkpoint("worksheet ready"), c.succeed({ sheets: 1 }), t;
|
|
826
826
|
} catch (e) {
|
|
827
827
|
let t = l;
|
|
828
|
-
throw
|
|
828
|
+
throw be(o, t ? () => t.destroy() : void 0), e;
|
|
829
829
|
}
|
|
830
830
|
} catch (e) {
|
|
831
831
|
throw c.fail(e), e;
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
static async load(t, n = {}) {
|
|
835
|
-
let r =
|
|
835
|
+
let r = Tt(n);
|
|
836
836
|
if (n = {
|
|
837
837
|
...n,
|
|
838
838
|
xlsxWorksheetLimits: r.worksheet
|
|
839
|
-
}, n.legacyXls !== void 0) return (await import("./workbook-model-source-
|
|
839
|
+
}, n.legacyXls !== void 0) return (await import("./workbook-model-source-CI1q6nxK.js")).loadXlsxModelSource(t, n, e);
|
|
840
840
|
n = {
|
|
841
841
|
...n,
|
|
842
|
-
cjkFallback:
|
|
842
|
+
cjkFallback: N(n.cjkFallback)
|
|
843
843
|
};
|
|
844
|
-
let i =
|
|
844
|
+
let i = C(n), a = n.mode ?? "main", o = new T({
|
|
845
845
|
enabled: !0,
|
|
846
846
|
format: "xlsx",
|
|
847
847
|
mode: a,
|
|
@@ -861,26 +861,26 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
861
861
|
s = v(await y(s, n.password));
|
|
862
862
|
let c = s === r;
|
|
863
863
|
o.setSourceBytes(s.byteLength), o.checkpoint("container ready");
|
|
864
|
-
let l = a === "worker" ? (await import("./render-worker-host-
|
|
864
|
+
let l = a === "worker" ? (await import("./render-worker-host-stI5Lppz.js")).createRenderWorker() : new Qt(), u;
|
|
865
865
|
try {
|
|
866
866
|
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;
|
|
867
867
|
} catch (e) {
|
|
868
868
|
let t = u;
|
|
869
|
-
throw
|
|
869
|
+
throw be(l, t ? () => t.destroy() : void 0), e;
|
|
870
870
|
}
|
|
871
871
|
} catch (e) {
|
|
872
872
|
throw o.fail(e), e;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
async _load(e, t = {}, n =
|
|
876
|
-
let a =
|
|
875
|
+
async _load(e, t = {}, n = w(t), r, i = !1) {
|
|
876
|
+
let a = Tt(t), o = this.requireBridge();
|
|
877
877
|
this.worksheetPolicy = a, this.resourceFailure = null, this.retainedSheetUsage = {
|
|
878
878
|
rows: 0,
|
|
879
879
|
cells: 0,
|
|
880
880
|
ownedUtf8Bytes: 0,
|
|
881
881
|
jsonBytes: 0
|
|
882
|
-
}, this.sheetCache.clear(), this.sheetCacheUsage.clear(), this.sheetLeases.clear(), this.completePendingEvictions(), await this.worksheetPullClient?.cancelAll("closed"), this.worksheetPullClient = null, this.generation = (this.generation ?? 0) + 1, this.workerTimeoutMs = t.workerTimeoutMs, this.googleSubstitutes = t.useGoogleFonts === !0, this.cjkFallback =
|
|
883
|
-
let s = this._mode === "worker" ?
|
|
882
|
+
}, this.sheetCache.clear(), this.sheetCacheUsage.clear(), this.sheetLeases.clear(), this.completePendingEvictions(), await this.worksheetPullClient?.cancelAll("closed"), this.worksheetPullClient = null, this.generation = (this.generation ?? 0) + 1, this.workerTimeoutMs = t.workerTimeoutMs, this.googleSubstitutes = t.useGoogleFonts === !0, this.cjkFallback = N(t.cjkFallback), this.math = this._mode === "worker" ? void 0 : t.math, this.threeD = this._mode === "worker" ? void 0 : t.threeD, this.regionMap = this._mode === "worker" ? void 0 : t.regionMap, this.chartEx = this._mode === "worker" ? void 0 : t.chartEx, this.tiff = this._mode === "worker" ? void 0 : t.tiff;
|
|
883
|
+
let s = this._mode === "worker" ? St(t) : void 0;
|
|
884
884
|
t.math && this._mode === "worker" && !s?.math && console.warn("[ooxml] a custom math renderer cannot cross the worker boundary; equations will be skipped in mode: 'worker'. Use the math renderer from @silurus/ooxml/math."), t.threeD && this._mode === "worker" && !s?.threeD && console.warn("[ooxml] a custom 3-D chart renderer cannot cross the worker boundary; charts use their 2-D family fallback in mode: 'worker'. Use the renderer from @silurus/ooxml/three-d."), t.regionMap && this._mode === "worker" && !s?.regionMap && console.warn("[ooxml] a custom Region Map renderer cannot cross the worker boundary; geospatial charts use the unsupported-chart placeholder in mode: 'worker'. Use the renderer from @silurus/ooxml/region-map."), t.chartEx && this._mode === "worker" && !s?.chartEx && console.warn("[ooxml] a custom ChartEx renderer cannot cross the worker boundary; ChartEx charts use the unsupported-chart placeholder in mode: 'worker'. Use the renderer from @silurus/ooxml/chart-ex."), t.tiff && this._mode === "worker" && !s?.tiff && console.warn("[ooxml] a custom TIFF codec cannot cross the worker boundary; recognized TIFF images will use an unavailable-image placeholder in mode: 'worker'. Use the codec from @silurus/ooxml/tiff to display them.");
|
|
885
885
|
let c = i ? e.slice(0) : e, l = await o.request((e) => this._mode === "worker" ? {
|
|
886
886
|
type: "parse",
|
|
@@ -908,14 +908,14 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
908
908
|
}
|
|
909
909
|
let u = this.parsedWorkbook;
|
|
910
910
|
if (!u) throw Error("XLSX worker returned no workbook metadata");
|
|
911
|
-
this.cjkFallback =
|
|
911
|
+
this.cjkFallback = Ye(u, this.cjkFallback), this.ensureWorksheetPullClient();
|
|
912
912
|
let d = u.workbook.parseError;
|
|
913
|
-
d && console.warn(`[ooxml] xlsx opened with a degraded part: ${d}`), this.officeFontRequests =
|
|
913
|
+
d && console.warn(`[ooxml] xlsx opened with a degraded part: ${d}`), this.officeFontRequests = Le(u), t.useGoogleFonts && (this.googleFontNames = [...xt(u, this.cjkFallback)]), typeof document < "u" && document.fonts && await this.retainFontsInSet(document.fonts);
|
|
914
914
|
}
|
|
915
915
|
async _loadDelimitedText(e, t, n) {
|
|
916
|
-
let r =
|
|
917
|
-
this.worksheetPolicy = r, this.delimitedTextBacked = !0, this.workerTimeoutMs = t.workerTimeoutMs, this.googleSubstitutes = t.useGoogleFonts === !0, this.cjkFallback =
|
|
918
|
-
let a = this._mode === "worker" ?
|
|
916
|
+
let r = Tt(t), i = this.requireBridge();
|
|
917
|
+
this.worksheetPolicy = r, this.delimitedTextBacked = !0, this.workerTimeoutMs = t.workerTimeoutMs, this.googleSubstitutes = t.useGoogleFonts === !0, this.cjkFallback = N(t.cjkFallback), this.generation++, this.math = this._mode === "worker" ? void 0 : t.math, this.threeD = this._mode === "worker" ? void 0 : t.threeD, this.regionMap = this._mode === "worker" ? void 0 : t.regionMap, this.chartEx = this._mode === "worker" ? void 0 : t.chartEx, this.tiff = this._mode === "worker" ? void 0 : t.tiff;
|
|
918
|
+
let a = this._mode === "worker" ? St(t) : void 0, o = await i.request((i) => ({
|
|
919
919
|
type: "parseDelimitedText",
|
|
920
920
|
japaneseCellFonts: this.japaneseCellFonts,
|
|
921
921
|
id: i,
|
|
@@ -926,14 +926,14 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
926
926
|
cjkFallback: this.cjkFallback,
|
|
927
927
|
renderers: a
|
|
928
928
|
}), [e], { timeoutMs: t.workerTimeoutMs }), s = JSON.parse(new TextDecoder().decode(o.worksheetJson));
|
|
929
|
-
|
|
929
|
+
kt(s, r), Qe(s, this.japaneseCellFonts);
|
|
930
930
|
let c = o.workbook.workbook.sheets;
|
|
931
931
|
if (c.length !== 1 || c[0]?.name !== s.name) throw Error("Delimited text worker returned inconsistent worksheet metadata");
|
|
932
|
-
let l =
|
|
933
|
-
if (
|
|
932
|
+
let l = Mt(s, r);
|
|
933
|
+
if (Dt(l, "load-delimited-text", void 0, void 0, r), Rt(l.jsonBytes, "load-delimited-text", void 0, void 0, r), jt(l, "load-delimited-text", void 0, void 0, r), this.parsedWorkbook = o.workbook, this.cjkFallback = Ye(o.workbook, this.cjkFallback), this.sheetCache.set(0, s), this.sheetCacheUsage.set(0, l), this.retainedSheetUsage = l, this.officeFontRequests = Le(o.workbook), t.useGoogleFonts && (this.googleFontNames = [...xt(o.workbook, this.cjkFallback)]), typeof document < "u" && document.fonts) {
|
|
934
934
|
await this.retainFontsInSet(document.fonts), await this.retainWorksheetOfficeFonts(s);
|
|
935
935
|
let e = this.retainedFontSets.get(document.fonts)?.loaded?.office;
|
|
936
|
-
|
|
936
|
+
mt(s, e?.routes, this.googleSubstitutes);
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
async retainFontsInSet(e) {
|
|
@@ -941,7 +941,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
941
941
|
let t = this.retainedFontSets.get(e);
|
|
942
942
|
if (t) t.refs++;
|
|
943
943
|
else {
|
|
944
|
-
let n = Promise.all([
|
|
944
|
+
let n = Promise.all([E(this.googleFontNames, Ge, e), ne(this.officeFontRequests, e)]).then(([e, t]) => ({
|
|
945
945
|
google: e,
|
|
946
946
|
office: t
|
|
947
947
|
}));
|
|
@@ -950,7 +950,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
950
950
|
loaded: null,
|
|
951
951
|
loading: n
|
|
952
952
|
}, this.retainedFontSets.set(e, t), n.then((e) => {
|
|
953
|
-
t.loaded = e, this.fontsDestroyed && (
|
|
953
|
+
t.loaded = e, this.fontsDestroyed && (S(e.google), I(e.office.faces));
|
|
954
954
|
});
|
|
955
955
|
}
|
|
956
956
|
await t.loading;
|
|
@@ -959,16 +959,16 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
959
959
|
if (n) return;
|
|
960
960
|
n = !0;
|
|
961
961
|
let r = this.retainedFontSets.get(e);
|
|
962
|
-
r === t && (r.refs--, !(r.refs > 0) && (this.retainedFontSets.delete(e), r.loaded ? (
|
|
963
|
-
|
|
962
|
+
r === t && (r.refs--, !(r.refs > 0) && (this.retainedFontSets.delete(e), r.loaded ? (S(r.loaded.google), I(r.loaded.office.faces)) : r.loading.then((e) => {
|
|
963
|
+
S(e.google), I(e.office.faces);
|
|
964
964
|
})));
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
967
|
async retainWorksheetOfficeFonts(e) {
|
|
968
|
-
let t =
|
|
968
|
+
let t = $e(e).filter((e) => !this.officeFontRequests.some((t) => Ue(t) === Ue(e)));
|
|
969
969
|
t.length !== 0 && (this.officeFontRequests.push(...t), await Promise.all([...this.retainedFontSets].map(async ([e, n]) => {
|
|
970
|
-
let r = await n.loading, i = await
|
|
971
|
-
if (this.fontsDestroyed || this.retainedFontSets.get(e) !== n || n.refs <= 0)
|
|
970
|
+
let r = await n.loading, i = await ne(t, e);
|
|
971
|
+
if (this.fontsDestroyed || this.retainedFontSets.get(e) !== n || n.refs <= 0) I(i.faces);
|
|
972
972
|
else {
|
|
973
973
|
r.office.faces.push(...i.faces);
|
|
974
974
|
let e = new Set(r.office.checked);
|
|
@@ -977,13 +977,13 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
977
977
|
}
|
|
978
978
|
})));
|
|
979
979
|
}
|
|
980
|
-
async [
|
|
980
|
+
async [Hn](e) {
|
|
981
981
|
return await this.retainFontsInSet(e.fonts);
|
|
982
982
|
}
|
|
983
|
-
[
|
|
983
|
+
[Un](e, t) {
|
|
984
984
|
if (!this.parsedWorkbook) return;
|
|
985
985
|
let n = b(t.canvas) ? t.canvas.ownerDocument.fonts : null;
|
|
986
|
-
|
|
986
|
+
dt(t, e, n ? this.retainedFontSets.get(n)?.loaded?.office.routes : void 0, this.googleSubstitutes), H(e), ht(t, e, this.parsedWorkbook.styles, this.cjkFallback);
|
|
987
987
|
}
|
|
988
988
|
get sheetNames() {
|
|
989
989
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.name) ?? [];
|
|
@@ -995,7 +995,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
995
995
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.tabColor ?? null) ?? [];
|
|
996
996
|
}
|
|
997
997
|
sheetVisibility(e) {
|
|
998
|
-
return
|
|
998
|
+
return en(this.parsedWorkbook?.workbook.sheets ?? [], e);
|
|
999
999
|
}
|
|
1000
1000
|
isHidden(e) {
|
|
1001
1001
|
return this.sheetVisibility(e) !== "visible";
|
|
@@ -1016,7 +1016,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1016
1016
|
if (t) return this.touchWorksheet(e, t), t;
|
|
1017
1017
|
let n = this.sheetLoads.get(e);
|
|
1018
1018
|
if (n) return n;
|
|
1019
|
-
let r = new
|
|
1019
|
+
let r = new In([]);
|
|
1020
1020
|
(this.sheetPreviews ??= /* @__PURE__ */ new Map()).set(e, r);
|
|
1021
1021
|
let i = this.loadWorksheet(e, r);
|
|
1022
1022
|
i.catch((e) => r.fail(e)), this.sheetLoads.set(e, i);
|
|
@@ -1093,7 +1093,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1093
1093
|
if (!t) throw Error("OOXML resource metrics are not ready");
|
|
1094
1094
|
return t;
|
|
1095
1095
|
}
|
|
1096
|
-
return
|
|
1096
|
+
return x(e, async (e) => (await this.requireBridge().request((e) => ({
|
|
1097
1097
|
type: "resourceUsage",
|
|
1098
1098
|
id: e
|
|
1099
1099
|
}), void 0, { timeoutMs: e })).usage);
|
|
@@ -1113,47 +1113,47 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1113
1113
|
try {
|
|
1114
1114
|
for await (let u of i.stream(e, t)) {
|
|
1115
1115
|
if (u.kind === "preview") {
|
|
1116
|
-
if (u.worksheet && (
|
|
1117
|
-
|
|
1116
|
+
if (u.worksheet && (kt(u.worksheet, r), Qe(u.worksheet, this.japaneseCellFonts)), n.preview(u.worksheet, u.reason, u.maxRow, u.maxCol), u.worksheet) {
|
|
1117
|
+
zn(u.worksheet, {
|
|
1118
1118
|
maxRow: u.maxRow,
|
|
1119
1119
|
maxCol: u.maxCol
|
|
1120
1120
|
}), await this.retainWorksheetOfficeFonts(u.worksheet);
|
|
1121
1121
|
let e = typeof document < "u" ? this.retainedFontSets.get(document.fonts)?.loaded?.office : void 0;
|
|
1122
|
-
|
|
1122
|
+
mt(u.worksheet, e?.routes, this.googleSubstitutes);
|
|
1123
1123
|
}
|
|
1124
1124
|
continue;
|
|
1125
1125
|
}
|
|
1126
1126
|
if (u.kind === "rows") {
|
|
1127
|
-
let e =
|
|
1128
|
-
|
|
1127
|
+
let e = Et(o, Ft(u.rows, r), r);
|
|
1128
|
+
Dt(e, "get-worksheet", void 0, u.usage, r), n.append(u.rows), o = e;
|
|
1129
1129
|
continue;
|
|
1130
1130
|
}
|
|
1131
1131
|
let e = u.worksheet;
|
|
1132
|
-
|
|
1133
|
-
let t =
|
|
1132
|
+
kt(e, r), Qe(e, this.japaneseCellFonts), e.rows = e.parseError ? [] : a;
|
|
1133
|
+
let t = Ot(e, e.parseError ? {
|
|
1134
1134
|
rows: 0,
|
|
1135
1135
|
cells: 0,
|
|
1136
1136
|
ownedUtf8Bytes: 0
|
|
1137
1137
|
} : o, r);
|
|
1138
|
-
|
|
1139
|
-
let i = this.retainedSheetUsage, d =
|
|
1138
|
+
Dt(t, "get-worksheet", void 0, u.usage, r), Rt(t.jsonBytes, "get-worksheet", void 0, u.usage, r);
|
|
1139
|
+
let i = this.retainedSheetUsage, d = It(i, t, {}, r), f = [];
|
|
1140
1140
|
for (let [e] of this.sheetCache) {
|
|
1141
1141
|
try {
|
|
1142
|
-
|
|
1142
|
+
jt(d, "get-worksheet", void 0, u.usage, r);
|
|
1143
1143
|
break;
|
|
1144
1144
|
} catch (e) {
|
|
1145
1145
|
if (!(e instanceof g)) throw e;
|
|
1146
1146
|
}
|
|
1147
1147
|
if ((this.sheetLeases.get(e) ?? 0) > 0) continue;
|
|
1148
1148
|
let n = this.sheetCacheUsage.get(e);
|
|
1149
|
-
n && (i =
|
|
1149
|
+
n && (i = It(i, {
|
|
1150
1150
|
rows: 0,
|
|
1151
1151
|
cells: 0,
|
|
1152
1152
|
ownedUtf8Bytes: 0,
|
|
1153
1153
|
jsonBytes: 0
|
|
1154
|
-
}, n, r), d =
|
|
1154
|
+
}, n, r), d = It(i, t, {}, r), f.push(e));
|
|
1155
1155
|
}
|
|
1156
|
-
|
|
1156
|
+
jt(d, "get-worksheet", void 0, u.usage, r);
|
|
1157
1157
|
let p;
|
|
1158
1158
|
if (f.length && this._mode === "worker") {
|
|
1159
1159
|
let e;
|
|
@@ -1187,7 +1187,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1187
1187
|
if (u = !0, !s || !c || !l) throw Error(`XLSX worksheet ${e} did not produce a terminal model`);
|
|
1188
1188
|
this.retainedSheetUsage = c, this.sheetCache.set(e, s), this.sheetCacheUsage.set(e, l), await this.retainWorksheetOfficeFonts(s);
|
|
1189
1189
|
let d = typeof document < "u" ? this.retainedFontSets.get(document.fonts)?.loaded?.office : void 0;
|
|
1190
|
-
return
|
|
1190
|
+
return mt(s, d?.routes, this.googleSubstitutes), n.finish(s), s;
|
|
1191
1191
|
} catch (e) {
|
|
1192
1192
|
throw this._mode === "worker" && s && !u && this.destroy(), this.latchFatalResourceFailure(e), n.fail(e), e;
|
|
1193
1193
|
}
|
|
@@ -1195,9 +1195,9 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1195
1195
|
ensureWorksheetPullClient() {
|
|
1196
1196
|
if (this.worksheetPullClient) return this.worksheetPullClient;
|
|
1197
1197
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
1198
|
-
return this.worksheetPullClient = new
|
|
1198
|
+
return this.worksheetPullClient = new Lt({
|
|
1199
1199
|
generation: this.generation || 1,
|
|
1200
|
-
transport: this.requireBridge().transport(
|
|
1200
|
+
transport: this.requireBridge().transport(Nt),
|
|
1201
1201
|
sharedStrings: this.parsedWorkbook.sharedStrings,
|
|
1202
1202
|
timeoutMs: this.workerTimeoutMs,
|
|
1203
1203
|
open: async (e, t, n, r) => {
|
|
@@ -1252,8 +1252,8 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1252
1252
|
}
|
|
1253
1253
|
async resolveValidationList(e, t) {
|
|
1254
1254
|
if (this.assertResourceHealthy(), !this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
1255
|
-
let n =
|
|
1256
|
-
if (n.kind !== "range") return
|
|
1255
|
+
let n = Sn(t);
|
|
1256
|
+
if (n.kind !== "range") return Cn(n, () => null);
|
|
1257
1257
|
let r = e;
|
|
1258
1258
|
if (n.sheet) {
|
|
1259
1259
|
let e = this.sheetNames.findIndex((e) => e.toLowerCase() === n.sheet?.toLowerCase());
|
|
@@ -1267,22 +1267,22 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1267
1267
|
try {
|
|
1268
1268
|
let e = i.worksheet, t = this.parsedWorkbook.styles, r = /* @__PURE__ */ new Map();
|
|
1269
1269
|
for (let t of e.rows) for (let e of t.cells) r.set(`${e.row}:${e.col}`, e);
|
|
1270
|
-
return
|
|
1270
|
+
return Cn(n, (n, i) => {
|
|
1271
1271
|
let a = r.get(`${n}:${i}`);
|
|
1272
|
-
return a ?
|
|
1272
|
+
return a ? We(a, t, null, e.date1904) : null;
|
|
1273
1273
|
});
|
|
1274
1274
|
} finally {
|
|
1275
1275
|
i.release();
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
1278
|
cellText(e, t) {
|
|
1279
|
-
return this.parsedWorkbook ?
|
|
1279
|
+
return this.parsedWorkbook ? We(t, this.parsedWorkbook.styles, null, e.date1904) : "";
|
|
1280
1280
|
}
|
|
1281
|
-
[
|
|
1281
|
+
[Kn](e) {
|
|
1282
1282
|
let t = this.parsedWorkbook;
|
|
1283
1283
|
if (!t) return () => [];
|
|
1284
|
-
let n = t.styles, r = e.conditionalFormats?.length ?
|
|
1285
|
-
return (t) =>
|
|
1284
|
+
let n = t.styles, r = e.conditionalFormats?.length ? Ke(e) : null;
|
|
1285
|
+
return (t) => Ve(t, n, r ? Je(t, t.row, t.col, r, n.dxfs ?? []).numFmt : null, e.date1904);
|
|
1286
1286
|
}
|
|
1287
1287
|
async renderViewport(e, t, n, r = {}) {
|
|
1288
1288
|
if (this.assertResourceHealthy(), n = {
|
|
@@ -1292,11 +1292,11 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1292
1292
|
cols: n.cols
|
|
1293
1293
|
}, this._mode === "worker") throw Error("renderViewport(canvas) is unavailable in mode: 'worker'; use renderViewportToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
1294
1294
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
1295
|
-
let i = this.parsedWorkbook.styles, a =
|
|
1295
|
+
let i = this.parsedWorkbook.styles, a = jn(r), { sizeOverrides: o, ...s } = a.opts, c = b(e) ? e.ownerDocument.fonts : typeof document < "u" ? document.fonts : null, l = this.sheetPreviews?.get(t);
|
|
1296
1296
|
if (l?.worksheet && a.worksheet) {
|
|
1297
1297
|
await l.waitFor(Math.max(n.row + n.rows - 1, s.freezeRows ?? 0)), this.assertResourceHealthy();
|
|
1298
1298
|
let t = a.worksheet;
|
|
1299
|
-
await
|
|
1299
|
+
await vn({
|
|
1300
1300
|
ws: t,
|
|
1301
1301
|
styles: i,
|
|
1302
1302
|
cjkFallback: this.cjkFallback,
|
|
@@ -1315,8 +1315,8 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1315
1315
|
return;
|
|
1316
1316
|
}
|
|
1317
1317
|
return this.withWorksheetArchiveOperation(t, (t) => {
|
|
1318
|
-
let r = a.worksheet ??
|
|
1319
|
-
return r !== t &&
|
|
1318
|
+
let r = a.worksheet ?? Dn(t, o);
|
|
1319
|
+
return r !== t && pt(t, r), vn({
|
|
1320
1320
|
ws: r,
|
|
1321
1321
|
styles: i,
|
|
1322
1322
|
cjkFallback: this.cjkFallback,
|
|
@@ -1341,7 +1341,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1341
1341
|
rows: t.rows,
|
|
1342
1342
|
cols: t.cols
|
|
1343
1343
|
};
|
|
1344
|
-
let r =
|
|
1344
|
+
let r = jn(n), i = {
|
|
1345
1345
|
...r.opts,
|
|
1346
1346
|
dpr: n.dpr ?? D()
|
|
1347
1347
|
};
|
|
@@ -1365,7 +1365,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1365
1365
|
let a = new OffscreenCanvas(1, 1);
|
|
1366
1366
|
return await this.renderViewport(a, e, t, i), a.transferToImageBitmap();
|
|
1367
1367
|
}
|
|
1368
|
-
[
|
|
1368
|
+
[Wn](e) {
|
|
1369
1369
|
this._mode !== "worker" || !this.bridge || this.bridge.post({
|
|
1370
1370
|
type: "releaseViewProjection",
|
|
1371
1371
|
projectionId: e
|
|
@@ -1393,7 +1393,7 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1393
1393
|
a = e, o = t;
|
|
1394
1394
|
});
|
|
1395
1395
|
s.catch(() => void 0), this.sheetLoads.set(e, s);
|
|
1396
|
-
let c = new
|
|
1396
|
+
let c = new In([]);
|
|
1397
1397
|
return (this.sheetPreviews ??= /* @__PURE__ */ new Map()).set(e, c), this.runArchiveOperation(async () => {
|
|
1398
1398
|
try {
|
|
1399
1399
|
let n = await this.loadWorksheetStream(e, i.name, c);
|
|
@@ -1414,8 +1414,8 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1414
1414
|
}, this.sheetLoads.clear();
|
|
1415
1415
|
for (let e of this.sheetPreviews?.values() ?? []) e.fail(/* @__PURE__ */ Error("XLSX workbook has been destroyed"));
|
|
1416
1416
|
this.sheetPreviews?.clear(), this.fontsDestroyed = !0;
|
|
1417
|
-
for (let e of this.retainedFontSets.values()) e.loaded && (
|
|
1418
|
-
this.retainedFontSets.clear(), this.googleFontNames = [], this.googleSubstitutes = !1, this.officeFontRequests = [],
|
|
1417
|
+
for (let e of this.retainedFontSets.values()) e.loaded && (S(e.loaded.google), I(e.loaded.office.faces));
|
|
1418
|
+
this.retainedFontSets.clear(), this.googleFontNames = [], this.googleSubstitutes = !1, this.officeFontRequests = [], P(this._fetchImage), te(this._fetchImage), this.rawParts.clear(), this.queuedImageLoads?.clear();
|
|
1419
1419
|
}
|
|
1420
1420
|
assertResourceHealthy() {
|
|
1421
1421
|
if (this.resourceFailure) throw this.resourceFailure;
|
|
@@ -1432,64 +1432,64 @@ var Un = Symbol("retain-xlsx-viewer-fonts"), Wn = Symbol("prepare-xlsx-viewer-ro
|
|
|
1432
1432
|
return this.bridge;
|
|
1433
1433
|
}
|
|
1434
1434
|
};
|
|
1435
|
-
function
|
|
1435
|
+
function Jn(e, t) {
|
|
1436
1436
|
return e.acquireWorksheetLease(t);
|
|
1437
1437
|
}
|
|
1438
|
-
function
|
|
1438
|
+
function Yn(e, t) {
|
|
1439
1439
|
let n = e.acquireWorksheetPreviewLease;
|
|
1440
|
-
return typeof n == "function" ? n.call(e, t) :
|
|
1440
|
+
return typeof n == "function" ? n.call(e, t) : Jn(e, t).then((e) => ({
|
|
1441
1441
|
...e,
|
|
1442
1442
|
partial: !1,
|
|
1443
1443
|
completion: Promise.resolve(e.worksheet)
|
|
1444
1444
|
}));
|
|
1445
1445
|
}
|
|
1446
|
-
function
|
|
1446
|
+
function Xn(e, t) {
|
|
1447
1447
|
let n = e.retainWorksheetReference;
|
|
1448
1448
|
return typeof n == "function" ? n.call(e, t) : Promise.resolve(() => void 0);
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1450
|
+
function Zn(e, t) {
|
|
1451
1451
|
return e.top <= t.row + t.rows - 1 && e.bottom >= t.row && e.left <= t.col + t.cols - 1 && e.right >= t.col;
|
|
1452
1452
|
}
|
|
1453
|
-
function
|
|
1453
|
+
function Qn(e, t) {
|
|
1454
1454
|
let n = e.fromRow + 1 > t.row + t.rows - 1 && Number.isFinite(e.fromRowOff) && e.fromRowOff >= 0, r = e.fromCol + 1 > t.col + t.cols - 1 && Number.isFinite(e.fromColOff) && e.fromColOff >= 0;
|
|
1455
1455
|
return !n && !r;
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1457
|
+
function $n(e, t, n, r) {
|
|
1458
1458
|
for (let i of e.conditionalFormats ?? []) if (i.sqref.filter((e) => e.top <= n && e.bottom >= t).length !== 0) {
|
|
1459
1459
|
for (let e of i.rules) if (e.type !== "other" && !(e.type === "cellIs" && e.formulas.every((e) => /^\s*[-+]?(?:\d+(?:\.\d*)?|\.\d+)\s*$/.test(e))) && (i.sqref.some((e) => e.bottom > r) || "activeFormula" in e && e.activeFormula && !/^\s*[-+]?(?:\d+(?:\.\d*)?|\.\d+)\s*$/.test(e.activeFormula) || e.type === "cellIs" || e.type === "expression")) return "conditional-format-range";
|
|
1460
1460
|
}
|
|
1461
1461
|
return null;
|
|
1462
1462
|
}
|
|
1463
|
-
function
|
|
1464
|
-
return (e.mergeCells ?? []).some((e) =>
|
|
1463
|
+
function er(e, t, n) {
|
|
1464
|
+
return (e.mergeCells ?? []).some((e) => Zn(e, t) && e.bottom > n) ? "merge-range" : $n(e, t.row, t.row + t.rows - 1, n) || ((e.charts ?? []).some((e) => Qn(e, t)) || (e.shapeGroups ?? []).some((e) => Qn(e, t)) || (e.slicers ?? []).some((e) => Qn(e, t)) ? "drawing-dependency" : (e.sparklineGroups ?? []).some((e) => e.sparklines.some((e) => e.row >= t.row && e.row < t.row + t.rows && e.col >= t.col && e.col < t.col + t.cols)) ? "sparkline-dependency" : null);
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1467
|
-
return t < 1 ? null :
|
|
1466
|
+
function tr(e, t, n) {
|
|
1467
|
+
return t < 1 ? null : $n(e, 1, t, n) ? "drawing-dependency" : null;
|
|
1468
1468
|
}
|
|
1469
|
-
function
|
|
1470
|
-
let n =
|
|
1469
|
+
function nr(e, t) {
|
|
1470
|
+
let n = Ie(t.worksheet, e, t.colAxis, t.rowAxis, t.scale), { width: r, height: i } = n;
|
|
1471
1471
|
if (r <= 0 || i <= 0) return null;
|
|
1472
1472
|
let a = t.colAxis.offsetOf(t.startCol), o = t.rowAxis.offsetOf(t.startRow);
|
|
1473
1473
|
return {
|
|
1474
|
-
x:
|
|
1474
|
+
x: V(t.scrollAreaX + (n.x - a) - t.scrollOffsetX, r, t.canvasWidth, t.rtl),
|
|
1475
1475
|
y: t.scrollAreaY + (n.y - o) - t.scrollOffsetY,
|
|
1476
1476
|
width: r,
|
|
1477
1477
|
height: i
|
|
1478
1478
|
};
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function rr(e, t) {
|
|
1481
1481
|
return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height;
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1484
|
-
let n =
|
|
1483
|
+
function ir(e, t) {
|
|
1484
|
+
let n = V(t.scrollAreaX, t.scrollAreaW, t.canvasWidth, t.rtl);
|
|
1485
1485
|
return e.x + e.width >= n && e.x <= n + t.scrollAreaW && e.y + e.height >= t.scrollAreaY && e.y <= t.scrollAreaY + t.scrollAreaH;
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1488
|
-
let n =
|
|
1487
|
+
function ar(e, t) {
|
|
1488
|
+
let n = V(t.scrollAreaX, t.scrollAreaW, t.canvasWidth, t.rtl);
|
|
1489
1489
|
return e.x >= n && e.x <= n + t.scrollAreaW && e.y >= t.scrollAreaY && e.y <= t.scrollAreaY + t.scrollAreaH;
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1492
|
-
let n =
|
|
1491
|
+
function or(e, t) {
|
|
1492
|
+
let n = H(e), r = t.cellScale, { col: i, row: a } = n.axesAtScale(r), o = Math.round(50 * r), s = Math.round(22 * r), c = i.bandsToCover(1, t.freezeCols, Math.max(0, t.width - o)), l = a.bandsToCover(1, t.freezeRows, Math.max(0, t.height - s)), u = c.reduce((e, t) => e + t.size, 0), d = l.reduce((e, t) => e + t.size, 0);
|
|
1493
1493
|
return {
|
|
1494
1494
|
worksheet: e,
|
|
1495
1495
|
colAxis: i,
|
|
@@ -1507,11 +1507,11 @@ function sr(e, t) {
|
|
|
1507
1507
|
canvasWidth: t.width
|
|
1508
1508
|
};
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1511
|
-
let r =
|
|
1510
|
+
function sr(e, t, n) {
|
|
1511
|
+
let r = or(e, n), i, a = 0;
|
|
1512
1512
|
if (i = t.elementType === "chart" ? e.charts[t.elementIndex] : t.elementType === "image" ? e.images[t.elementIndex] : (e.shapeGroups ?? [])[t.elementIndex], !i) return null;
|
|
1513
|
-
let o =
|
|
1514
|
-
if (!o || !
|
|
1513
|
+
let o = nr(i, r);
|
|
1514
|
+
if (!o || !ir(o, r)) return null;
|
|
1515
1515
|
if (t.elementType === "shape") {
|
|
1516
1516
|
let n = (e.shapeGroups ?? [])[t.elementIndex], r = t.shapeIndex === void 0 ? void 0 : n?.shapes[t.shapeIndex];
|
|
1517
1517
|
r && (o = {
|
|
@@ -1521,7 +1521,7 @@ function cr(e, t, n) {
|
|
|
1521
1521
|
height: r.h * o.height
|
|
1522
1522
|
}, a = r.rot);
|
|
1523
1523
|
}
|
|
1524
|
-
let s =
|
|
1524
|
+
let s = V(r.scrollAreaX, r.scrollAreaW, r.canvasWidth, r.rtl);
|
|
1525
1525
|
return {
|
|
1526
1526
|
rect: o,
|
|
1527
1527
|
clip: {
|
|
@@ -1533,7 +1533,7 @@ function cr(e, t, n) {
|
|
|
1533
1533
|
rotation: a
|
|
1534
1534
|
};
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1536
|
+
function cr(e) {
|
|
1537
1537
|
return {
|
|
1538
1538
|
from: {
|
|
1539
1539
|
row: e.fromRow + 1,
|
|
@@ -1549,7 +1549,7 @@ function lr(e) {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
};
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1552
|
+
function lr(e, t) {
|
|
1553
1553
|
if (!e.text) return {
|
|
1554
1554
|
truncated: !1,
|
|
1555
1555
|
textCharacters: 0
|
|
@@ -1564,7 +1564,7 @@ function ur(e, t) {
|
|
|
1564
1564
|
n.push("\n"), r++;
|
|
1565
1565
|
}
|
|
1566
1566
|
for (let e of o.runs) {
|
|
1567
|
-
let a = e.type === "text" ? e.text : e.type === "break" ? "\n" : "[equation]", o =
|
|
1567
|
+
let a = e.type === "text" ? e.text : e.type === "break" ? "\n" : "[equation]", o = Ae(a, Math.max(0, t - r));
|
|
1568
1568
|
if (n.push(o), r += o.length, o.length < a.length) {
|
|
1569
1569
|
i = !0;
|
|
1570
1570
|
break;
|
|
@@ -1578,7 +1578,7 @@ function ur(e, t) {
|
|
|
1578
1578
|
textCharacters: r
|
|
1579
1579
|
};
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1581
|
+
function ur(e, t, n, r, i, a, o, s) {
|
|
1582
1582
|
return {
|
|
1583
1583
|
format: "xlsx",
|
|
1584
1584
|
kind: "element",
|
|
@@ -1586,7 +1586,7 @@ function dr(e, t, n, r, i, a, o, s) {
|
|
|
1586
1586
|
sheetName: e.name,
|
|
1587
1587
|
elementType: n,
|
|
1588
1588
|
elementIndex: r,
|
|
1589
|
-
anchor:
|
|
1589
|
+
anchor: cr(i),
|
|
1590
1590
|
...a === void 0 ? {} : { text: a },
|
|
1591
1591
|
truncated: o,
|
|
1592
1592
|
truncationReasons: o ? ["text"] : [],
|
|
@@ -1594,19 +1594,19 @@ function dr(e, t, n, r, i, a, o, s) {
|
|
|
1594
1594
|
maxTextCharacters: s
|
|
1595
1595
|
};
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1597
|
+
function dr(e, t, n, r, i) {
|
|
1598
1598
|
for (let a = e.charts.length - 1; a >= 0; a--) {
|
|
1599
|
-
let o = e.charts[a], s =
|
|
1600
|
-
if (!s || !
|
|
1601
|
-
let c =
|
|
1599
|
+
let o = e.charts[a], s = nr(o, r);
|
|
1600
|
+
if (!s || !ir(s, r) || !rr(n, s)) continue;
|
|
1601
|
+
let c = Te(o.chart, i);
|
|
1602
1602
|
return {
|
|
1603
|
-
...
|
|
1603
|
+
...ur(e, t, "chart", a, o, c.text, c.truncated, c.maxTextCharacters),
|
|
1604
1604
|
seriesCount: o.chart.series.length
|
|
1605
1605
|
};
|
|
1606
1606
|
}
|
|
1607
1607
|
return null;
|
|
1608
1608
|
}
|
|
1609
|
-
function
|
|
1609
|
+
function fr(e, t, n) {
|
|
1610
1610
|
let r = {
|
|
1611
1611
|
x: t.x + n.x * t.width,
|
|
1612
1612
|
y: t.y + n.y * t.height,
|
|
@@ -1618,21 +1618,21 @@ function pr(e, t, n) {
|
|
|
1618
1618
|
y: u
|
|
1619
1619
|
};
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1621
|
+
function pr(e, t, n, r, i) {
|
|
1622
1622
|
let a = e.shapeGroups ?? [];
|
|
1623
1623
|
for (let o = a.length - 1; o >= 0; o--) {
|
|
1624
|
-
let s = a[o], c =
|
|
1625
|
-
if (!(!c || !
|
|
1624
|
+
let s = a[o], c = nr(s, r);
|
|
1625
|
+
if (!(!c || !ir(c, r))) for (let r = s.shapes.length - 1; r >= 0; r--) {
|
|
1626
1626
|
let a = s.shapes[r];
|
|
1627
|
-
if (!
|
|
1627
|
+
if (!rr(fr(n, c, a), {
|
|
1628
1628
|
x: c.x + a.x * c.width,
|
|
1629
1629
|
y: c.y + a.y * c.height,
|
|
1630
1630
|
width: a.w * c.width,
|
|
1631
1631
|
height: a.h * c.height
|
|
1632
1632
|
})) continue;
|
|
1633
|
-
let l =
|
|
1633
|
+
let l = lr(a, i);
|
|
1634
1634
|
return {
|
|
1635
|
-
...
|
|
1635
|
+
...ur(e, t, "shape", o, s, l.text, l.truncated, i),
|
|
1636
1636
|
shapeIndex: r,
|
|
1637
1637
|
shapeCount: s.shapes.length,
|
|
1638
1638
|
...a.geom.type === "image" ? { mimeType: a.geom.mimeType } : {}
|
|
@@ -1641,26 +1641,26 @@ function mr(e, t, n, r, i) {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
return null;
|
|
1643
1643
|
}
|
|
1644
|
-
function
|
|
1644
|
+
function mr(e, t, n, r, i) {
|
|
1645
1645
|
for (let a = e.images.length - 1; a >= 0; a--) {
|
|
1646
|
-
let o = e.images[a], s =
|
|
1647
|
-
if (s &&
|
|
1648
|
-
...
|
|
1646
|
+
let o = e.images[a], s = nr(o, r);
|
|
1647
|
+
if (s && ir(Re(s, o.rotation), r) && rr(Xe(n, s, o.rotation, o.flipH, o.flipV), s)) return {
|
|
1648
|
+
...ur(e, t, "image", a, o, void 0, !1, i),
|
|
1649
1649
|
mimeType: o.svgImagePath ? "image/svg+xml" : o.mimeType
|
|
1650
1650
|
};
|
|
1651
1651
|
}
|
|
1652
1652
|
return null;
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1654
|
+
function hr(e, t, n, r, i = we) {
|
|
1655
1655
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) throw RangeError("XLSX hit-test point must contain finite coordinates.");
|
|
1656
1656
|
if (!Number.isFinite(i) || i < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
1657
|
-
let a = Math.min(
|
|
1658
|
-
return
|
|
1657
|
+
let a = Math.min(we, Math.floor(i)), o = or(e, r);
|
|
1658
|
+
return ar(n, o) ? dr(e, t, n, o, a) ?? pr(e, t, n, o, a) ?? mr(e, t, n, o, a) : null;
|
|
1659
1659
|
}
|
|
1660
|
-
function
|
|
1660
|
+
function gr(e, t) {
|
|
1661
1661
|
let n = t ?? e.maxTextCharacters;
|
|
1662
1662
|
if (!Number.isFinite(n) || n < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
1663
|
-
let r = Math.min(
|
|
1663
|
+
let r = Math.min(we, Math.floor(n)), i = e.text === void 0 ? void 0 : Ae(e.text, r), a = e.truncated || e.text !== void 0 && i.length < e.text.length;
|
|
1664
1664
|
return {
|
|
1665
1665
|
...structuredClone(e),
|
|
1666
1666
|
...i === void 0 ? {} : { text: i },
|
|
@@ -1670,17 +1670,17 @@ function _r(e, t) {
|
|
|
1670
1670
|
maxTextCharacters: r
|
|
1671
1671
|
};
|
|
1672
1672
|
}
|
|
1673
|
-
var
|
|
1674
|
-
function
|
|
1675
|
-
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) *
|
|
1673
|
+
var _r = 128, vr = 1e4, yr = 8 * 1024 * 1024;
|
|
1674
|
+
function br(e) {
|
|
1675
|
+
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) * G : t.kind === "columns" ? (t.lastColumn - t.firstColumn + 1) * K : K * G), 0);
|
|
1676
1676
|
}
|
|
1677
|
-
function
|
|
1677
|
+
function Y(e, t) {
|
|
1678
1678
|
return Number.isInteger(e) && e >= 1 && e <= t;
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1680
|
+
function xr(e) {
|
|
1681
1681
|
switch (e.kind) {
|
|
1682
1682
|
case "cells":
|
|
1683
|
-
if (!
|
|
1683
|
+
if (!Y(e.top, 1048576) || !Y(e.bottom, 1048576) || !Y(e.left, 16384) || !Y(e.right, 16384)) throw RangeError("Cell selection bounds must be inside the XLSX grid.");
|
|
1684
1684
|
return {
|
|
1685
1685
|
kind: "cells",
|
|
1686
1686
|
top: Math.min(e.top, e.bottom),
|
|
@@ -1689,14 +1689,14 @@ function Sr(e) {
|
|
|
1689
1689
|
right: Math.max(e.left, e.right)
|
|
1690
1690
|
};
|
|
1691
1691
|
case "rows":
|
|
1692
|
-
if (!
|
|
1692
|
+
if (!Y(e.firstRow, 1048576) || !Y(e.lastRow, 1048576)) throw RangeError("Row selection bounds must be inside the XLSX grid.");
|
|
1693
1693
|
return {
|
|
1694
1694
|
kind: "rows",
|
|
1695
1695
|
firstRow: Math.min(e.firstRow, e.lastRow),
|
|
1696
1696
|
lastRow: Math.max(e.firstRow, e.lastRow)
|
|
1697
1697
|
};
|
|
1698
1698
|
case "columns":
|
|
1699
|
-
if (!
|
|
1699
|
+
if (!Y(e.firstColumn, 16384) || !Y(e.lastColumn, 16384)) throw RangeError("Column selection bounds must be inside the XLSX grid.");
|
|
1700
1700
|
return {
|
|
1701
1701
|
kind: "columns",
|
|
1702
1702
|
firstColumn: Math.min(e.firstColumn, e.lastColumn),
|
|
@@ -1705,7 +1705,7 @@ function Sr(e) {
|
|
|
1705
1705
|
case "sheet": return { kind: "sheet" };
|
|
1706
1706
|
}
|
|
1707
1707
|
}
|
|
1708
|
-
function
|
|
1708
|
+
function Sr(e, t) {
|
|
1709
1709
|
switch (e.kind) {
|
|
1710
1710
|
case "cells": return t.row >= e.top && t.row <= e.bottom && t.col >= e.left && t.col <= e.right;
|
|
1711
1711
|
case "rows": return t.row >= e.firstRow && t.row <= e.lastRow;
|
|
@@ -1713,25 +1713,25 @@ function Cr(e, t) {
|
|
|
1713
1713
|
case "sheet": return !0;
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
function
|
|
1717
|
-
if (!
|
|
1716
|
+
function Cr(e, t) {
|
|
1717
|
+
if (!Y(e.row, 1048576) || !Y(e.col, 16384)) throw RangeError(`${t} must be inside the XLSX grid.`);
|
|
1718
1718
|
return {
|
|
1719
1719
|
row: e.row,
|
|
1720
1720
|
col: e.col
|
|
1721
1721
|
};
|
|
1722
1722
|
}
|
|
1723
|
-
function
|
|
1723
|
+
function X(e) {
|
|
1724
1724
|
if (!Array.isArray(e.areas) || e.areas.length === 0) throw TypeError("A selection must contain at least one area.");
|
|
1725
1725
|
if (e.areas.length > 128) throw RangeError("A selection may contain at most 128 areas.");
|
|
1726
1726
|
if (!Number.isInteger(e.activeAreaIndex) || e.activeAreaIndex < 0 || e.activeAreaIndex >= e.areas.length) throw RangeError("activeAreaIndex must identify an area in the selection.");
|
|
1727
|
-
let t = e.areas.map(
|
|
1727
|
+
let t = e.areas.map(xr), n = [], r = /* @__PURE__ */ new Map(), i = 0;
|
|
1728
1728
|
for (let a = 0; a < t.length; a++) {
|
|
1729
1729
|
let o = t[a], s = o.kind === "cells" ? `c:${o.top}:${o.left}:${o.bottom}:${o.right}` : o.kind === "rows" ? `r:${o.firstRow}:${o.lastRow}` : o.kind === "columns" ? `k:${o.firstColumn}:${o.lastColumn}` : "s", c = r.get(s);
|
|
1730
1730
|
c === void 0 && (c = n.length, r.set(s, c), n.push(o)), a === e.activeAreaIndex && (i = c);
|
|
1731
1731
|
}
|
|
1732
|
-
let a =
|
|
1733
|
-
if (!
|
|
1734
|
-
if (!
|
|
1732
|
+
let a = Cr(e.activeCell, "activeCell"), o = Cr(e.extensionAnchor, "extensionAnchor"), s = n[i];
|
|
1733
|
+
if (!Sr(s, a)) throw RangeError("activeCell must be inside the active selection area.");
|
|
1734
|
+
if (!Sr(s, o)) throw RangeError("extensionAnchor must be inside the active selection area.");
|
|
1735
1735
|
return {
|
|
1736
1736
|
areas: n,
|
|
1737
1737
|
activeAreaIndex: i,
|
|
@@ -1739,16 +1739,16 @@ function Y(e) {
|
|
|
1739
1739
|
extensionAnchor: o
|
|
1740
1740
|
};
|
|
1741
1741
|
}
|
|
1742
|
-
function
|
|
1742
|
+
function wr(e) {
|
|
1743
1743
|
let t = 0;
|
|
1744
1744
|
for (let n of e) t = t * 26 + n.charCodeAt(0) - 64;
|
|
1745
1745
|
return t >= 1 && t <= 16384 ? t : null;
|
|
1746
1746
|
}
|
|
1747
|
-
function
|
|
1747
|
+
function Tr(e) {
|
|
1748
1748
|
let t = e.trim().toUpperCase(), n = /^\$?(\d+):\$?(\d+)$/.exec(t);
|
|
1749
1749
|
if (n) {
|
|
1750
1750
|
let e = Number(n[1]), t = Number(n[2]);
|
|
1751
|
-
if (!
|
|
1751
|
+
if (!Y(e, 1048576) || !Y(t, 1048576)) return null;
|
|
1752
1752
|
let r = Math.min(e, t);
|
|
1753
1753
|
return {
|
|
1754
1754
|
areas: [{
|
|
@@ -1769,7 +1769,7 @@ function Er(e) {
|
|
|
1769
1769
|
}
|
|
1770
1770
|
let r = /^\$?([A-Z]+):\$?([A-Z]+)$/.exec(t);
|
|
1771
1771
|
if (r) {
|
|
1772
|
-
let e =
|
|
1772
|
+
let e = wr(r[1]), t = wr(r[2]);
|
|
1773
1773
|
if (e === null || t === null) return null;
|
|
1774
1774
|
let n = Math.min(e, t);
|
|
1775
1775
|
return {
|
|
@@ -1791,7 +1791,7 @@ function Er(e) {
|
|
|
1791
1791
|
}
|
|
1792
1792
|
let i = t.split(":");
|
|
1793
1793
|
if (i.length > 2) return null;
|
|
1794
|
-
let a =
|
|
1794
|
+
let a = z(i[0]), o = i.length === 2 ? z(i[1]) : a;
|
|
1795
1795
|
if (!a || !o) return null;
|
|
1796
1796
|
let s = {
|
|
1797
1797
|
kind: "cells",
|
|
@@ -1810,7 +1810,7 @@ function Er(e) {
|
|
|
1810
1810
|
extensionAnchor: c
|
|
1811
1811
|
};
|
|
1812
1812
|
}
|
|
1813
|
-
function
|
|
1813
|
+
function Er(e, t) {
|
|
1814
1814
|
return e === t ? !0 : !e || !t || e.activeAreaIndex !== t.activeAreaIndex || e.areas.length !== t.areas.length || e.activeCell.row !== t.activeCell.row || e.activeCell.col !== t.activeCell.col || e.extensionAnchor.row !== t.extensionAnchor.row || e.extensionAnchor.col !== t.extensionAnchor.col ? !1 : e.areas.every((e, n) => JSON.stringify(e) === JSON.stringify(t.areas[n]));
|
|
1815
1815
|
}
|
|
1816
1816
|
function Dr(e, t, n) {
|
|
@@ -1836,7 +1836,7 @@ function Dr(e, t, n) {
|
|
|
1836
1836
|
});
|
|
1837
1837
|
}
|
|
1838
1838
|
}
|
|
1839
|
-
return
|
|
1839
|
+
return Gt(i), Object.freeze(i.map((e) => Object.freeze(e)));
|
|
1840
1840
|
}
|
|
1841
1841
|
var Or = class {
|
|
1842
1842
|
stashedRowHeights = /* @__PURE__ */ new Map();
|
|
@@ -1863,11 +1863,11 @@ var Or = class {
|
|
|
1863
1863
|
let t = this.stashedRowHeights.get(r);
|
|
1864
1864
|
t === void 0 ? delete e.rowHeights[r] : e.rowHeights[r] = t, this.stashedRowHeights.delete(r);
|
|
1865
1865
|
} else e.rowHeights[r] === 0 && delete e.rowHeights[r];
|
|
1866
|
-
else if (i) this.stashedColWidths.has(r) || (this.stashedColWidths.set(r, e.colWidths[r]), this.stashedColCssWidths.set(r,
|
|
1866
|
+
else if (i) this.stashedColWidths.has(r) || (this.stashedColWidths.set(r, e.colWidths[r]), this.stashedColCssWidths.set(r, Ut(e, r))), e.colWidths[r] = 0, W(e, r, null);
|
|
1867
1867
|
else if (this.stashedColWidths.has(r)) {
|
|
1868
1868
|
let t = this.stashedColWidths.get(r);
|
|
1869
|
-
t === void 0 ? delete e.colWidths[r] : e.colWidths[r] = t,
|
|
1870
|
-
} else e.colWidths[r] === 0 && (delete e.colWidths[r],
|
|
1869
|
+
t === void 0 ? delete e.colWidths[r] : e.colWidths[r] = t, W(e, r, this.stashedColCssWidths.get(r) ?? null), this.stashedColWidths.delete(r), this.stashedColCssWidths.delete(r);
|
|
1870
|
+
} else e.colWidths[r] === 0 && (delete e.colWidths[r], W(e, r, null));
|
|
1871
1871
|
this.recordSizeOverride(e, t, n, r);
|
|
1872
1872
|
}
|
|
1873
1873
|
recordSizeOverride(e, t, n, r, i) {
|
|
@@ -1883,8 +1883,8 @@ var Or = class {
|
|
|
1883
1883
|
n === "row" && a.automaticRows.delete(r);
|
|
1884
1884
|
let s = n === "row" ? e.rowHeights[r] ?? null : e.colWidths[r] ?? null, c = !1;
|
|
1885
1885
|
if (o.get(r) !== s && (o.set(r, s), c = !0), n === "col") {
|
|
1886
|
-
i !== void 0 &&
|
|
1887
|
-
let t =
|
|
1886
|
+
i !== void 0 && W(e, r, i);
|
|
1887
|
+
let t = Ut(e, r) ?? null;
|
|
1888
1888
|
(a.colCss.has(r) ? a.colCss.get(r) !== t : t !== null) && (a.colCss.set(r, t), c = !0);
|
|
1889
1889
|
}
|
|
1890
1890
|
c && (a.revision++, a.wire = void 0);
|
|
@@ -1895,7 +1895,7 @@ var Or = class {
|
|
|
1895
1895
|
if (o > r) throw RangeError(`A resize projection may retain at most ${r} manually edited bands per axis.`);
|
|
1896
1896
|
}
|
|
1897
1897
|
beginRowResizePreview(e, t, n) {
|
|
1898
|
-
let r =
|
|
1898
|
+
let r = Wt(e), i = !1, a = (n) => {
|
|
1899
1899
|
let r = this.sizeOverrideStore.get(t);
|
|
1900
1900
|
!r && n.length && (r = {
|
|
1901
1901
|
rows: /* @__PURE__ */ new Map(),
|
|
@@ -1903,7 +1903,7 @@ var Or = class {
|
|
|
1903
1903
|
cols: /* @__PURE__ */ new Map(),
|
|
1904
1904
|
colCss: /* @__PURE__ */ new Map(),
|
|
1905
1905
|
revision: 0
|
|
1906
|
-
}, this.sizeOverrideStore.set(t, r)),
|
|
1906
|
+
}, this.sizeOverrideStore.set(t, r)), Yt(e, n), r && (r.rowHeightRanges = n, r.revision++, r.wire = void 0), q.invalidate(e);
|
|
1907
1907
|
};
|
|
1908
1908
|
return {
|
|
1909
1909
|
apply: (e) => {
|
|
@@ -1915,8 +1915,8 @@ var Or = class {
|
|
|
1915
1915
|
};
|
|
1916
1916
|
}
|
|
1917
1917
|
restoreRowResizeRanges(e, t) {
|
|
1918
|
-
let n = this.sizeOverrideStore.get(e)?.rowHeightRanges ?? [], r =
|
|
1919
|
-
(n.length || r.length) && n !== r && (
|
|
1918
|
+
let n = this.sizeOverrideStore.get(e)?.rowHeightRanges ?? [], r = Wt(t);
|
|
1919
|
+
(n.length || r.length) && n !== r && (Yt(t, n), q.invalidate(t));
|
|
1920
1920
|
}
|
|
1921
1921
|
wireSizeOverrides(e) {
|
|
1922
1922
|
let t = this.sizeOverrideStore.get(e);
|
|
@@ -1944,7 +1944,7 @@ var Or = class {
|
|
|
1944
1944
|
return this.sizeOverrideStore.get(e)?.revision ?? 0;
|
|
1945
1945
|
}
|
|
1946
1946
|
syncAutomaticRowOverrides(e, t) {
|
|
1947
|
-
let n = new Map(
|
|
1947
|
+
let n = new Map(ft(t)), r = this.sizeOverrideStore.get(e);
|
|
1948
1948
|
!r && n.size === 0 || (r || (r = {
|
|
1949
1949
|
rows: /* @__PURE__ */ new Map(),
|
|
1950
1950
|
automaticRows: /* @__PURE__ */ new Map(),
|
|
@@ -1966,7 +1966,7 @@ var Or = class {
|
|
|
1966
1966
|
if (n) {
|
|
1967
1967
|
for (let [e, r] of n.rows) r === null ? delete t.rowHeights[e] : t.rowHeights[e] = r;
|
|
1968
1968
|
for (let [e, r] of n.cols) r === null ? delete t.colWidths[e] : t.colWidths[e] = r;
|
|
1969
|
-
for (let [e, r] of n.colCss)
|
|
1969
|
+
for (let [e, r] of n.colCss) W(t, e, r);
|
|
1970
1970
|
}
|
|
1971
1971
|
let r = this.outlineStateStore.get(e);
|
|
1972
1972
|
if (r) {
|
|
@@ -2215,7 +2215,7 @@ var Z = class {
|
|
|
2215
2215
|
u.setTransform(l, 0, 0, l, 0, 0), u.clearRect(0, 0, s, c), u.fillStyle = r.background ?? "#f5f5f5", u.fillRect(0, 0, s, c);
|
|
2216
2216
|
let d = 19 * n;
|
|
2217
2217
|
u.strokeStyle = r.border ?? "#808080", u.lineWidth = 1, u.fillStyle = r.text ?? "#404040";
|
|
2218
|
-
let f =
|
|
2218
|
+
let f = H(t), p = f.effectiveFrozenBands({
|
|
2219
2219
|
scale: n,
|
|
2220
2220
|
width: this.host.canvasArea.clientWidth,
|
|
2221
2221
|
height: this.host.canvasArea.clientHeight,
|
|
@@ -2560,13 +2560,13 @@ function ei(e, t, n) {
|
|
|
2560
2560
|
if (!e) return !1;
|
|
2561
2561
|
for (let r of e.split(/\s+/)) {
|
|
2562
2562
|
if (!r) continue;
|
|
2563
|
-
let [e, i] = r.split(":"), a =
|
|
2563
|
+
let [e, i] = r.split(":"), a = z(e);
|
|
2564
2564
|
if (!a) continue;
|
|
2565
2565
|
if (!i) {
|
|
2566
2566
|
if (a.row === t && a.col === n) return !0;
|
|
2567
2567
|
continue;
|
|
2568
2568
|
}
|
|
2569
|
-
let o =
|
|
2569
|
+
let o = z(i);
|
|
2570
2570
|
if (!o) continue;
|
|
2571
2571
|
let s = Math.min(a.row, o.row), c = Math.max(a.row, o.row), l = Math.min(a.col, o.col), u = Math.max(a.col, o.col);
|
|
2572
2572
|
if (t >= s && t <= c && n >= l && n <= u) return !0;
|
|
@@ -2669,7 +2669,7 @@ var ni = class {
|
|
|
2669
2669
|
if (!t) return;
|
|
2670
2670
|
let n = this.host.screenX(t.x, t.w);
|
|
2671
2671
|
this.panel.style.left = "-9999px", this.panel.style.top = "-9999px", this.panel.style.display = "block";
|
|
2672
|
-
let r =
|
|
2672
|
+
let r = wn({
|
|
2673
2673
|
cell: {
|
|
2674
2674
|
x: n,
|
|
2675
2675
|
y: t.y,
|
|
@@ -2716,7 +2716,7 @@ function ai(e) {
|
|
|
2716
2716
|
}
|
|
2717
2717
|
function oi(e, t, n) {
|
|
2718
2718
|
let r = ii(e), i = r >= 0 ? ai(e.slice(0, r)) : void 0, a = (r >= 0 ? e.slice(r + 1) : e).split(":", 1)[0]?.trim() ?? "";
|
|
2719
|
-
if (!
|
|
2719
|
+
if (!z(a)) return null;
|
|
2720
2720
|
let o = t;
|
|
2721
2721
|
if (i !== void 0) {
|
|
2722
2722
|
let e = i.toLocaleLowerCase("en-US");
|
|
@@ -2769,7 +2769,7 @@ var ci = class {
|
|
|
2769
2769
|
};
|
|
2770
2770
|
else return !1;
|
|
2771
2771
|
let r = this.host.onHyperlinkClick();
|
|
2772
|
-
return r ? (r(n), !0) : (n.kind === "external" ?
|
|
2772
|
+
return r ? (r(n), !0) : (n.kind === "external" ? ie(n.url, void 0, this.host.hostWindow) : this.navigateInternal(n.ref).catch((e) => this.host.reportError(e)), !0);
|
|
2773
2773
|
}
|
|
2774
2774
|
async navigateInternal(e) {
|
|
2775
2775
|
let t = si(e, this.host.currentSheet(), this.host.sheetNames(), this.host.definedNames());
|
|
@@ -2811,7 +2811,7 @@ var ci = class {
|
|
|
2811
2811
|
return t ? {
|
|
2812
2812
|
sheet: t.sheet,
|
|
2813
2813
|
sheetName: t.sheetName,
|
|
2814
|
-
ref:
|
|
2814
|
+
ref: st(t.row, t.col),
|
|
2815
2815
|
row: t.row,
|
|
2816
2816
|
col: t.col
|
|
2817
2817
|
} : null;
|
|
@@ -2841,7 +2841,7 @@ var ci = class {
|
|
|
2841
2841
|
if (n !== this._generation) return [];
|
|
2842
2842
|
let o = this._sheetName(a);
|
|
2843
2843
|
for (let n of r) for (let r of [n.text, ...n.alternates ?? []]) {
|
|
2844
|
-
let s =
|
|
2844
|
+
let s = xe(Ee([{ text: r }]), e, t);
|
|
2845
2845
|
for (let e of s) {
|
|
2846
2846
|
let t = e.slices[0], s = r.slice(t.start, t.end);
|
|
2847
2847
|
i.push({
|
|
@@ -2858,10 +2858,10 @@ var ci = class {
|
|
|
2858
2858
|
return n === this._generation ? (this._matches = i, this._active = -1, this.matches()) : [];
|
|
2859
2859
|
}
|
|
2860
2860
|
next() {
|
|
2861
|
-
return this._active =
|
|
2861
|
+
return this._active = Oe(this._active, this._matches.length), this._activePublic();
|
|
2862
2862
|
}
|
|
2863
2863
|
prev() {
|
|
2864
|
-
return this._active =
|
|
2864
|
+
return this._active = De(this._active, this._matches.length), this._activePublic();
|
|
2865
2865
|
}
|
|
2866
2866
|
_activePublic() {
|
|
2867
2867
|
let e = this._locationAt(this._active);
|
|
@@ -2888,9 +2888,9 @@ var pi = class {
|
|
|
2888
2888
|
async collectSheetCells(e) {
|
|
2889
2889
|
let t = this.host.workbook();
|
|
2890
2890
|
if (!t) return [];
|
|
2891
|
-
let n = await
|
|
2891
|
+
let n = await Jn(t, e);
|
|
2892
2892
|
try {
|
|
2893
|
-
let e = n.worksheet, r = [], i = t[
|
|
2893
|
+
let e = n.worksheet, r = [], i = t[Kn](e);
|
|
2894
2894
|
for (let t of e.rows) for (let e of t.cells) {
|
|
2895
2895
|
let [t = "", ...n] = i(e);
|
|
2896
2896
|
t !== "" && r.push(n.length > 0 ? {
|
|
@@ -2917,7 +2917,7 @@ var pi = class {
|
|
|
2917
2917
|
e.clearFind();
|
|
2918
2918
|
let t = this.host.worksheet();
|
|
2919
2919
|
if (!t) return;
|
|
2920
|
-
let n = this.host.scale(), r = (e) => Math.round(e * n), i = r(50), a = r(22), o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c =
|
|
2920
|
+
let n = this.host.scale(), r = (e) => Math.round(e * n), i = r(50), a = r(22), o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c = H(t).roundedFrozenExtent(n), l = i + c.width, u = a + c.height, d = this.host.highlightColors(), f = fi(!1, d), p = fi(!0, d);
|
|
2921
2921
|
for (let t of this.controller.sheetHighlights(this.host.currentSheet())) {
|
|
2922
2922
|
let n = this.host.cellRect(t.row, t.col);
|
|
2923
2923
|
if (!n) continue;
|
|
@@ -3112,7 +3112,7 @@ var Ei = class {
|
|
|
3112
3112
|
let i = this.host.scale(), a = this.host.canvasArea.getBoundingClientRect(), o = this.host.screenX(e - a.left, 0), s = t - a.top, c = Math.round(50 * i), l = Math.round(22 * i), u = o < c, d = s < l;
|
|
3113
3113
|
if (!u && !d) return null;
|
|
3114
3114
|
if (u && d) return { kind: "corner" };
|
|
3115
|
-
let f =
|
|
3115
|
+
let f = H(r), p = n === "logical" ? {
|
|
3116
3116
|
x: this.host.scrollLeft(),
|
|
3117
3117
|
y: this.host.scrollTop()
|
|
3118
3118
|
} : this.host.displayedViewportOffset();
|
|
@@ -3136,7 +3136,7 @@ var Ei = class {
|
|
|
3136
3136
|
getResizeTarget(e, t) {
|
|
3137
3137
|
let n = this.host.worksheet();
|
|
3138
3138
|
if (!n) return null;
|
|
3139
|
-
let r = this.host.scale(), i = this.host.canvasArea.getBoundingClientRect(), a = this.host.screenX(e - i.left, 0), o = t - i.top, s = Math.round(50 * r), c = Math.round(22 * r), l =
|
|
3139
|
+
let r = this.host.scale(), i = this.host.canvasArea.getBoundingClientRect(), a = this.host.screenX(e - i.left, 0), o = t - i.top, s = Math.round(50 * r), c = Math.round(22 * r), l = H(n), u = l.maximumDigitWidth, d = l.axesAtScale(r);
|
|
3140
3140
|
if (o <= c && a > s) {
|
|
3141
3141
|
let n = this.getHeaderHit(e, t);
|
|
3142
3142
|
if (n?.kind !== "col") return null;
|
|
@@ -3189,7 +3189,7 @@ var Ei = class {
|
|
|
3189
3189
|
t && e[0] <= t[1] + 1 ? t[1] = Math.max(t[1], e[1]) : i.push([...e]);
|
|
3190
3190
|
}
|
|
3191
3191
|
if (i.reduce((e, [t, n]) => e + n - t + 1, 0) > wi) throw RangeError(`A resize gesture may affect at most ${wi} selected bands.`);
|
|
3192
|
-
let a =
|
|
3192
|
+
let a = H(n), o = e === "col" ? a.col : a.row, s = [];
|
|
3193
3193
|
for (let [e, t] of i) for (let n = e; n <= t; n++) o.sizeOf(n) > 0 && s.push(n);
|
|
3194
3194
|
return s;
|
|
3195
3195
|
}
|
|
@@ -3209,9 +3209,9 @@ var Ei = class {
|
|
|
3209
3209
|
let t = i.at(-1);
|
|
3210
3210
|
t && e.first <= t.last + 1 ? t.last = Math.max(t.last, e.last) : i.push({ ...e });
|
|
3211
3211
|
}
|
|
3212
|
-
if (!t && !
|
|
3212
|
+
if (!t && !Wt(n).length && i.reduce((e, t) => e + t.last - t.first + 1, 0) <= wi) return;
|
|
3213
3213
|
let a = [], o = 0;
|
|
3214
|
-
for (let e of
|
|
3214
|
+
for (let e of H(n).row.positiveRanges()) {
|
|
3215
3215
|
for (; o < i.length && i[o].last < e.first;) o++;
|
|
3216
3216
|
for (let t = o; t < i.length && i[t].first <= e.last; t++) {
|
|
3217
3217
|
let n = Math.max(e.first, i[t].first), r = Math.min(e.last, i[t].last);
|
|
@@ -3255,21 +3255,21 @@ var Ei = class {
|
|
|
3255
3255
|
}
|
|
3256
3256
|
let i = this.host.scale(), a = this.host.canvasArea.getBoundingClientRect();
|
|
3257
3257
|
if (n.kind === "col") {
|
|
3258
|
-
let t = this.host.screenX(e - a.left, 0), o = Math.max(Ci, Math.round((t - n.originScaled) / i)), s =
|
|
3258
|
+
let t = this.host.screenX(e - a.left, 0), o = Math.max(Ci, Math.round((t - n.originScaled) / i)), s = Kt(o, n.mdw);
|
|
3259
3259
|
for (let e of n.indices) r.colWidths[e] = s, this.host.recordSizeOverride("col", e, o);
|
|
3260
3260
|
} else if (n.rowPreview) {
|
|
3261
3261
|
let e = t - a.top, o = Math.max(Ci, Math.round((e - n.originScaled) / i));
|
|
3262
3262
|
try {
|
|
3263
|
-
n.rowPreview.apply(
|
|
3263
|
+
n.rowPreview.apply(Jt(o)), this.host.updateSpacerSize(r), this.host.updateSelectionOverlay(), this.host.scheduleRender();
|
|
3264
3264
|
} catch (e) {
|
|
3265
3265
|
this.finishResize(n.pointerId, !1, !0), this.host.reportError(e);
|
|
3266
3266
|
}
|
|
3267
3267
|
return;
|
|
3268
3268
|
} else {
|
|
3269
|
-
let e = t - a.top, o =
|
|
3269
|
+
let e = t - a.top, o = Jt(Math.max(Ci, Math.round((e - n.originScaled) / i)));
|
|
3270
3270
|
for (let e of n.indices) r.rowHeights[e] = o, this.host.recordSizeOverride("row", e);
|
|
3271
3271
|
}
|
|
3272
|
-
|
|
3272
|
+
q.invalidate(r), this.host.updateSpacerSize(r), this.host.updateSelectionOverlay(), this.host.scheduleRender();
|
|
3273
3273
|
}
|
|
3274
3274
|
applyPointerSelection(e, t, n, r, i, a) {
|
|
3275
3275
|
let o = this.getHeaderHit(e, t);
|
|
@@ -3409,7 +3409,7 @@ var Ei = class {
|
|
|
3409
3409
|
if (r?.kind === "row") return n.areas.some((e) => e.kind === "sheet" || e.kind === "rows" && r.row >= e.firstRow && r.row <= e.lastRow);
|
|
3410
3410
|
if (r?.kind === "col") return n.areas.some((e) => e.kind === "sheet" || e.kind === "columns" && r.col >= e.firstColumn && r.col <= e.lastColumn);
|
|
3411
3411
|
let i = this.host.cellAt(e, t);
|
|
3412
|
-
return i !== null && n.areas.some((e) =>
|
|
3412
|
+
return i !== null && n.areas.some((e) => Sr(e, i));
|
|
3413
3413
|
}
|
|
3414
3414
|
resolveContextMenuContext(e) {
|
|
3415
3415
|
if (this.host.isDestroyed()) return Promise.resolve(null);
|
|
@@ -3562,7 +3562,7 @@ var Ei = class {
|
|
|
3562
3562
|
this.host.zoomAt(Number.isFinite(t) && Number.isFinite(n) ? {
|
|
3563
3563
|
x: t,
|
|
3564
3564
|
y: n
|
|
3565
|
-
} : null,
|
|
3565
|
+
} : null, ge(this.host.scale(), e.deltaY, e.deltaMode));
|
|
3566
3566
|
}, { passive: !1 }), this.on("pointerleave", (e) => {
|
|
3567
3567
|
let t = e.relatedTarget;
|
|
3568
3568
|
t && this.host.comments.contains(t) || this.host.hideCommentPopup();
|
|
@@ -3576,14 +3576,14 @@ var Ei = class {
|
|
|
3576
3576
|
e.preventDefault(), this.host.copySelection();
|
|
3577
3577
|
} else if (!e.defaultPrevented && !e.isComposing && !e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
3578
3578
|
let t = this.activeCell, n = e.key === "ArrowUp" ? -1 : +(e.key === "ArrowDown"), r = e.key === "ArrowLeft" ? this.host.isRtl() ? 1 : -1 : e.key === "ArrowRight" ? this.host.isRtl() ? -1 : 1 : 0, i = t ? {
|
|
3579
|
-
row: Math.max(1, Math.min(
|
|
3580
|
-
col: Math.max(1, Math.min(
|
|
3579
|
+
row: Math.max(1, Math.min(K, t.row + n)),
|
|
3580
|
+
col: Math.max(1, Math.min(G, t.col + r))
|
|
3581
3581
|
} : {
|
|
3582
3582
|
row: 1,
|
|
3583
3583
|
col: 1
|
|
3584
3584
|
};
|
|
3585
3585
|
e.preventDefault(), this.host.hideCommentPopup();
|
|
3586
|
-
let a =
|
|
3586
|
+
let a = st(i.row, i.col);
|
|
3587
3587
|
this.host.setSelection(a), this.host.scrollCellIntoView(i.row, i.col), this.host.updateSelectionOverlay(), this.host.updateFindOverlay(), this.host.emitViewportChange();
|
|
3588
3588
|
} else if (e.key === "Escape" && this.resizeDrag?.rowPreview) e.preventDefault(), this.finishResize(this.resizeDrag.pointerId, !1, !0);
|
|
3589
3589
|
else if (e.key === "Escape" && this.host.validation.isOpen()) this.host.hideValidationPanel();
|
|
@@ -3665,7 +3665,7 @@ var Ai = 0, ji = class {
|
|
|
3665
3665
|
if (!e) return;
|
|
3666
3666
|
let t = this.host.scale(), n = this.host.worksheet();
|
|
3667
3667
|
if (!n) return;
|
|
3668
|
-
let r = (e) => Math.round(e * t), i = r(50), a = r(22), o = this.host.canvasArea.clientWidth, s = this.host.canvasArea.clientHeight, c =
|
|
3668
|
+
let r = (e) => Math.round(e * t), i = r(50), a = r(22), o = this.host.canvasArea.clientWidth, s = this.host.canvasArea.clientHeight, c = H(n), l = c.effectiveFrozenBands({
|
|
3669
3669
|
scale: t,
|
|
3670
3670
|
width: o,
|
|
3671
3671
|
height: s,
|
|
@@ -3680,12 +3680,12 @@ var Ai = 0, ji = class {
|
|
|
3680
3680
|
end: Math.min(o, i + d)
|
|
3681
3681
|
}, {
|
|
3682
3682
|
first: l.cols + 1,
|
|
3683
|
-
last:
|
|
3683
|
+
last: G,
|
|
3684
3684
|
start: Math.min(o, i + d),
|
|
3685
3685
|
end: o
|
|
3686
3686
|
}] : [{
|
|
3687
3687
|
first: 1,
|
|
3688
|
-
last:
|
|
3688
|
+
last: G,
|
|
3689
3689
|
start: i,
|
|
3690
3690
|
end: o
|
|
3691
3691
|
}], m = l.rows > 0 ? [{
|
|
@@ -3695,12 +3695,12 @@ var Ai = 0, ji = class {
|
|
|
3695
3695
|
end: Math.min(s, a + f)
|
|
3696
3696
|
}, {
|
|
3697
3697
|
first: l.rows + 1,
|
|
3698
|
-
last:
|
|
3698
|
+
last: K,
|
|
3699
3699
|
start: Math.min(s, a + f),
|
|
3700
3700
|
end: s
|
|
3701
3701
|
}] : [{
|
|
3702
3702
|
first: 1,
|
|
3703
|
-
last:
|
|
3703
|
+
last: K,
|
|
3704
3704
|
start: a,
|
|
3705
3705
|
end: s
|
|
3706
3706
|
}], h = p.filter((e) => e.end > e.start), g = m.filter((e) => e.end > e.start), _ = this.host.selectionColor() ?? Di, { background: v } = Oi(_), y = /* @__PURE__ */ new Set(), b = [], x = [];
|
|
@@ -3718,14 +3718,14 @@ var Ai = 0, ji = class {
|
|
|
3718
3718
|
top: t.firstRow,
|
|
3719
3719
|
bottom: t.lastRow,
|
|
3720
3720
|
left: 1,
|
|
3721
|
-
right:
|
|
3721
|
+
right: G,
|
|
3722
3722
|
topEdge: !0,
|
|
3723
3723
|
bottomEdge: !0,
|
|
3724
3724
|
leftEdge: !1,
|
|
3725
3725
|
rightEdge: !1
|
|
3726
3726
|
} : t.kind === "columns" ? {
|
|
3727
3727
|
top: 1,
|
|
3728
|
-
bottom:
|
|
3728
|
+
bottom: K,
|
|
3729
3729
|
left: t.firstColumn,
|
|
3730
3730
|
right: t.lastColumn,
|
|
3731
3731
|
topEdge: !1,
|
|
@@ -3734,9 +3734,9 @@ var Ai = 0, ji = class {
|
|
|
3734
3734
|
rightEdge: !0
|
|
3735
3735
|
} : {
|
|
3736
3736
|
top: 1,
|
|
3737
|
-
bottom:
|
|
3737
|
+
bottom: K,
|
|
3738
3738
|
left: 1,
|
|
3739
|
-
right:
|
|
3739
|
+
right: G,
|
|
3740
3740
|
topEdge: !1,
|
|
3741
3741
|
bottomEdge: !1,
|
|
3742
3742
|
leftEdge: !1,
|
|
@@ -3749,28 +3749,28 @@ var Ai = 0, ji = class {
|
|
|
3749
3749
|
if (!u || !d) continue;
|
|
3750
3750
|
let f = u.x, p = u.y, m = d.x + d.w, _ = d.y + d.h, v = Math.max(f, r.start), S = Math.max(p, n.start), C = Math.min(m, r.end), w = Math.min(_, n.end), T = C - v, E = w - S;
|
|
3751
3751
|
if (T <= 0 || E <= 0) continue;
|
|
3752
|
-
let D = t.kind === "columns" && n === g[0], O = t.kind === "columns" && n === g.at(-1),
|
|
3753
|
-
|
|
3752
|
+
let D = t.kind === "columns" && n === g[0], O = t.kind === "columns" && n === g.at(-1), k = t.kind === "rows" && r === h[0], A = t.kind === "rows" && r === h.at(-1), j = D || e.topEdge && i === e.top && p >= n.start, M = O || e.bottomEdge && a === e.bottom && _ <= n.end, N = k || e.leftEdge && c === e.left && f >= r.start, P = A || e.rightEdge && l === e.right && m <= r.end, F = this.host.screenX(v, T), ee = this.host.isRtl() ? P : N, te = this.host.isRtl() ? N : P, ne = [
|
|
3753
|
+
F,
|
|
3754
3754
|
S,
|
|
3755
3755
|
T,
|
|
3756
3756
|
E,
|
|
3757
|
-
A,
|
|
3758
|
-
P,
|
|
3759
3757
|
j,
|
|
3760
|
-
|
|
3758
|
+
te,
|
|
3759
|
+
M,
|
|
3760
|
+
ee
|
|
3761
3761
|
].join("|");
|
|
3762
|
-
if (y.has(
|
|
3763
|
-
y.add(
|
|
3764
|
-
let
|
|
3762
|
+
if (y.has(ne)) continue;
|
|
3763
|
+
y.add(ne), b.push(`M${F} ${S}h${T}v${E}h${-T}Z`);
|
|
3764
|
+
let re = Math.min(1, T / 2), ie = Math.min(1, E / 2), I = this.host.isRtl() ? A : k, ae = this.host.isRtl() ? k : A, L = (e, t) => e <= 0 || e >= t, oe = F + (I && L(F, o) ? re : 0), se = F + T - (ae && L(F + T, o) ? re : 0), R = S + (D && L(S, s) ? ie : 0), ce = w - (O && L(w, s) ? ie : 0);
|
|
3765
3765
|
x.push({
|
|
3766
|
-
x:
|
|
3767
|
-
y:
|
|
3768
|
-
width:
|
|
3769
|
-
height:
|
|
3770
|
-
top:
|
|
3771
|
-
right:
|
|
3772
|
-
bottom:
|
|
3773
|
-
left:
|
|
3766
|
+
x: oe,
|
|
3767
|
+
y: R,
|
|
3768
|
+
width: se - oe,
|
|
3769
|
+
height: ce - R,
|
|
3770
|
+
top: j,
|
|
3771
|
+
right: te,
|
|
3772
|
+
bottom: M,
|
|
3773
|
+
left: ee
|
|
3774
3774
|
});
|
|
3775
3775
|
}
|
|
3776
3776
|
}
|
|
@@ -3807,7 +3807,7 @@ var Ai = 0, ji = class {
|
|
|
3807
3807
|
drawElementContextOverlay() {
|
|
3808
3808
|
let e = this.host.elementContext(), t = this.host.worksheet(), n = this.host.elementContextViewport();
|
|
3809
3809
|
if (!e || !t || !n || e.sheetIndex !== this.host.currentSheet()) return;
|
|
3810
|
-
let r =
|
|
3810
|
+
let r = sr(t, e, n);
|
|
3811
3811
|
if (!r) return;
|
|
3812
3812
|
let i = this.host.ownerDocument.createElement("div");
|
|
3813
3813
|
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;`;
|
|
@@ -3839,11 +3839,11 @@ var Ai = 0, ji = class {
|
|
|
3839
3839
|
}
|
|
3840
3840
|
emit() {
|
|
3841
3841
|
let e = this.host.selectionState();
|
|
3842
|
-
if (
|
|
3842
|
+
if (Er(e, this.lastNotified) || this.host.scheduleSelectionContextNotification(), this.emitting) {
|
|
3843
3843
|
this.pending = !0, this.scheduleNotification();
|
|
3844
3844
|
return;
|
|
3845
3845
|
}
|
|
3846
|
-
if (this.pending = !1,
|
|
3846
|
+
if (this.pending = !1, Er(e, this.lastNotified)) {
|
|
3847
3847
|
this.finishChain();
|
|
3848
3848
|
return;
|
|
3849
3849
|
}
|
|
@@ -3855,7 +3855,7 @@ var Ai = 0, ji = class {
|
|
|
3855
3855
|
try {
|
|
3856
3856
|
this.host.onSelectionStateChange()?.(e ? structuredClone(e) : null);
|
|
3857
3857
|
} finally {
|
|
3858
|
-
this.emitting = !1, this.pending || !
|
|
3858
|
+
this.emitting = !1, this.pending || !Er(this.host.selectionState(), this.lastNotified) ? this.scheduleNotification() : this.finishChain();
|
|
3859
3859
|
}
|
|
3860
3860
|
}
|
|
3861
3861
|
scheduleNotification() {
|
|
@@ -3905,7 +3905,7 @@ function Li(e, t) {
|
|
|
3905
3905
|
}
|
|
3906
3906
|
var Ri = 1 * 1024 * 1024, zi = 65536;
|
|
3907
3907
|
function Bi(e, t) {
|
|
3908
|
-
return
|
|
3908
|
+
return Ae(e, Math.max(0, t));
|
|
3909
3909
|
}
|
|
3910
3910
|
var Vi = class {
|
|
3911
3911
|
rows = /* @__PURE__ */ new WeakMap();
|
|
@@ -3913,9 +3913,9 @@ var Vi = class {
|
|
|
3913
3913
|
read(e, t, n, r, i, a) {
|
|
3914
3914
|
let o = a.maxCells ?? 1e3;
|
|
3915
3915
|
if (!Number.isFinite(o) || o < 0) throw RangeError("maxCells must be a finite non-negative number.");
|
|
3916
|
-
let s = Math.min(
|
|
3916
|
+
let s = Math.min(vr, Math.floor(o)), c = a.maxTextCharacters ?? Ri;
|
|
3917
3917
|
if (!Number.isFinite(c) || c < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
3918
|
-
let l = Math.min(
|
|
3918
|
+
let l = Math.min(yr, Math.floor(c)), u = 0, d = !1, f = (e) => {
|
|
3919
3919
|
let t = typeof e == "string" ? [e] : e, n = [], r = 0;
|
|
3920
3920
|
for (let e = 0; e < t.length; e++) {
|
|
3921
3921
|
let i = t[e], a = typeof i == "string" ? i : i.text, o = Math.max(0, Math.min(zi - r, l - u)), s = Bi(a, o);
|
|
@@ -3941,7 +3941,7 @@ var Vi = class {
|
|
|
3941
3941
|
active: !1
|
|
3942
3942
|
}]).sort((e, t) => e.row - t.row || Number(e.active) - Number(t.active)), v = /* @__PURE__ */ new Set(), y = 0, b = [], x = [], S = !1, C = p || h.length > 0 ? [{
|
|
3943
3943
|
first: 1,
|
|
3944
|
-
last:
|
|
3944
|
+
last: K
|
|
3945
3945
|
}] : $([...m, ...g.map((e) => ({
|
|
3946
3946
|
first: e.top,
|
|
3947
3947
|
last: e.bottom
|
|
@@ -3963,7 +3963,7 @@ var Vi = class {
|
|
|
3963
3963
|
}))));
|
|
3964
3964
|
let c = p || Fi(m, a.index) ? [{
|
|
3965
3965
|
first: 1,
|
|
3966
|
-
last:
|
|
3966
|
+
last: G
|
|
3967
3967
|
}] : $([...h, ...b]);
|
|
3968
3968
|
for (let t of c) {
|
|
3969
3969
|
let n = this.cells.get(a);
|
|
@@ -4016,7 +4016,7 @@ var Vi = class {
|
|
|
4016
4016
|
sheetIndex: t,
|
|
4017
4017
|
sheetName: e.name,
|
|
4018
4018
|
selection: n,
|
|
4019
|
-
coordinateCountUpperBound:
|
|
4019
|
+
coordinateCountUpperBound: br(n),
|
|
4020
4020
|
cells: x,
|
|
4021
4021
|
truncated: T.length > 0,
|
|
4022
4022
|
truncationReasons: T,
|
|
@@ -4100,7 +4100,7 @@ var Yi = 150;
|
|
|
4100
4100
|
function Xi(e) {
|
|
4101
4101
|
let t = /* @__PURE__ */ new Map();
|
|
4102
4102
|
for (let n of e) {
|
|
4103
|
-
let e =
|
|
4103
|
+
let e = z(n.cellRef);
|
|
4104
4104
|
e && t.set(`${e.row}:${e.col}`, n);
|
|
4105
4105
|
}
|
|
4106
4106
|
return t;
|
|
@@ -4219,7 +4219,7 @@ var Zi = class {
|
|
|
4219
4219
|
this.resizeObserver?.disconnect(), this.resizeObserver = null, this.hide(), this.commentMap.clear();
|
|
4220
4220
|
}
|
|
4221
4221
|
}, Qi = class {
|
|
4222
|
-
owner = new
|
|
4222
|
+
owner = new ke("SheetAcquisition");
|
|
4223
4223
|
get current() {
|
|
4224
4224
|
return this.owner.current;
|
|
4225
4225
|
}
|
|
@@ -4240,7 +4240,7 @@ function $i(e) {
|
|
|
4240
4240
|
rowHeights: { ...e.rowHeights },
|
|
4241
4241
|
colWidths: { ...e.colWidths }
|
|
4242
4242
|
};
|
|
4243
|
-
return e.colCollapsed && (t.colCollapsed = { ...e.colCollapsed }),
|
|
4243
|
+
return e.colCollapsed && (t.colCollapsed = { ...e.colCollapsed }), B(e, t), Bn(e, t), U(e, t), qt(e, t), t;
|
|
4244
4244
|
}
|
|
4245
4245
|
var ea = class {
|
|
4246
4246
|
scaleValue;
|
|
@@ -4302,7 +4302,7 @@ var ea = class {
|
|
|
4302
4302
|
this.frameScheduler = typeof r.requestAnimationFrame == "function" && typeof r.cancelAnimationFrame == "function" ? {
|
|
4303
4303
|
requestAnimationFrame: (e) => r.requestAnimationFrame(e),
|
|
4304
4304
|
cancelAnimationFrame: (e) => r.cancelAnimationFrame(e)
|
|
4305
|
-
} : null, this.staticDispatcher = e ? new
|
|
4305
|
+
} : null, this.staticDispatcher = e ? new Se(e, t) : null;
|
|
4306
4306
|
}
|
|
4307
4307
|
begin() {
|
|
4308
4308
|
return this.staticDispatcher ? this.staticDispatcher.begin() : ++this.generation;
|
|
@@ -4386,7 +4386,7 @@ var ea = class {
|
|
|
4386
4386
|
this.state = null, this.dragPointerId = null;
|
|
4387
4387
|
}
|
|
4388
4388
|
setState(e) {
|
|
4389
|
-
this.state = e ?
|
|
4389
|
+
this.state = e ? X(e) : null;
|
|
4390
4390
|
}
|
|
4391
4391
|
select(e, t = "cells") {
|
|
4392
4392
|
let n = t === "rows" ? {
|
|
@@ -4404,7 +4404,7 @@ var ea = class {
|
|
|
4404
4404
|
bottom: e.row,
|
|
4405
4405
|
right: e.col
|
|
4406
4406
|
};
|
|
4407
|
-
this.state =
|
|
4407
|
+
this.state = X({
|
|
4408
4408
|
areas: [n],
|
|
4409
4409
|
activeAreaIndex: 0,
|
|
4410
4410
|
activeCell: e,
|
|
@@ -4413,8 +4413,8 @@ var ea = class {
|
|
|
4413
4413
|
}
|
|
4414
4414
|
add(e, t = "cells") {
|
|
4415
4415
|
if (!this.state) return this.select(e, t), !0;
|
|
4416
|
-
let n = this.state.areas.findIndex((n) => (t === "rows" ? n.kind === "rows" : t === "cols" ? n.kind === "columns" : t === "all" ? n.kind === "sheet" : n.kind === "cells") &&
|
|
4417
|
-
if (n >= 0) return this.state =
|
|
4416
|
+
let n = this.state.areas.findIndex((n) => (t === "rows" ? n.kind === "rows" : t === "cols" ? n.kind === "columns" : t === "all" ? n.kind === "sheet" : n.kind === "cells") && Sr(n, e));
|
|
4417
|
+
if (n >= 0) return this.state = X({
|
|
4418
4418
|
...this.state,
|
|
4419
4419
|
activeAreaIndex: n,
|
|
4420
4420
|
activeCell: e,
|
|
@@ -4436,7 +4436,7 @@ var ea = class {
|
|
|
4436
4436
|
bottom: e.row,
|
|
4437
4437
|
right: e.col
|
|
4438
4438
|
}, i = [...this.state.areas, r];
|
|
4439
|
-
return this.state =
|
|
4439
|
+
return this.state = X({
|
|
4440
4440
|
areas: i,
|
|
4441
4441
|
activeAreaIndex: i.length - 1,
|
|
4442
4442
|
activeCell: e,
|
|
@@ -4465,7 +4465,7 @@ var ea = class {
|
|
|
4465
4465
|
bottom: Math.max(t.row, e.row),
|
|
4466
4466
|
right: Math.max(t.col, e.col)
|
|
4467
4467
|
}, i = [...this.state.areas];
|
|
4468
|
-
i[this.state.activeAreaIndex] = r, this.state =
|
|
4468
|
+
i[this.state.activeAreaIndex] = r, this.state = X({
|
|
4469
4469
|
...this.state,
|
|
4470
4470
|
areas: i
|
|
4471
4471
|
});
|
|
@@ -4647,8 +4647,8 @@ function ma(e, t, n) {
|
|
|
4647
4647
|
}
|
|
4648
4648
|
function ha(e) {
|
|
4649
4649
|
return {
|
|
4650
|
-
minRows: ma(e.minRows,
|
|
4651
|
-
minCols: ma(e.minCols,
|
|
4650
|
+
minRows: ma(e.minRows, Rn.minRows, "minRows"),
|
|
4651
|
+
minCols: ma(e.minCols, Rn.minCols, "minCols"),
|
|
4652
4652
|
marginRows: ma(e.marginRows, 30, "marginRows"),
|
|
4653
4653
|
marginCols: ma(e.marginCols, 10, "marginCols")
|
|
4654
4654
|
};
|
|
@@ -4736,7 +4736,7 @@ var ga = class {
|
|
|
4736
4736
|
if (!r) throw Error("XlsxViewer requires a document with an active Window");
|
|
4737
4737
|
this.hostWindow = r, this.opts = t, this.gridExtent = ha(t), this._mountKind = n.kind, this._nativeScrollbars = t.showScrollbars ?? !0;
|
|
4738
4738
|
let i = t[aa];
|
|
4739
|
-
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode :
|
|
4739
|
+
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode : Me("XlsxViewer", t.mode, i), this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.viewport = new ea(t.cellScale ?? 1), this.wrapper = this.hostDocument.createElement("div"), this.wrapper.style.cssText = `position:relative;width:100%;height:100%;background:${n.kind === "composite" ? "var(--ooxml-xlsx-chrome-surface,#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;", 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 ta(this.canvas, this._mode === "worker", this.hostWindow), this.scrollHost = this.hostDocument.createElement("div"), this.scrollHost.setAttribute("data-xlsx-viewport-input", n.kind), this.scrollHost.setAttribute("role", "region"), this.scrollHost.setAttribute("aria-label", "Spreadsheet viewport. Use Arrow keys to move the selected cell. Press Enter to show its comment."), this.scrollHost.tabIndex = 0, this.scrollHost.style.cssText = `position:absolute;inset:0;overflow:${this._nativeScrollbars ? "auto" : "clip"};z-index:2;background:transparent;scrollbar-color:var(--ooxml-xlsx-chrome-scrollbar-color,auto);`, 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 ra(this.canvas, this.canvasArea, this.scrollHost), this.overlayHost = new ia(this.canvasArea, this.canvas, this.scrollHost, {
|
|
4740
4740
|
commentMaxWidth: 280,
|
|
4741
4741
|
commentMaxHeight: 200,
|
|
4742
4742
|
validationMaxWidth: sa,
|
|
@@ -4916,7 +4916,7 @@ var ga = class {
|
|
|
4916
4916
|
async [oa](e, t = {}) {
|
|
4917
4917
|
if (this.assertOpen(), this._borrowed) throw Error(`${this._mountKind === "sheet" ? "XlsxSheetViewer" : "XlsxViewer"}.load() is unsupported on a Viewer created by fromWorkbook(); the borrowed workbook is already loaded.`);
|
|
4918
4918
|
try {
|
|
4919
|
-
let n = await this.acquisition.replace(() =>
|
|
4919
|
+
let n = await this.acquisition.replace(() => qn[Gn](e, pa(this.opts, this._mode), t), () => {
|
|
4920
4920
|
this.sheetRequestGeneration++, this.renderDispatcher.begin(), this.finder.invalidate(), this.hideValidationPanel(), this.releaseHostFonts();
|
|
4921
4921
|
});
|
|
4922
4922
|
if (!n) return;
|
|
@@ -4931,7 +4931,7 @@ var ga = class {
|
|
|
4931
4931
|
}
|
|
4932
4932
|
async ensureHostFonts(e) {
|
|
4933
4933
|
if (this.fontBinding?.workbook === e) return !0;
|
|
4934
|
-
let t = e[
|
|
4934
|
+
let t = e[Hn];
|
|
4935
4935
|
if (typeof t != "function") return !0;
|
|
4936
4936
|
let n = ++this.fontBindingGeneration, r = await t.call(e, this.hostDocument);
|
|
4937
4937
|
return this._destroyed || n !== this.fontBindingGeneration || this.wb !== e ? (r(), !1) : (this.fontBinding?.release(), this.fontBinding = {
|
|
@@ -4964,18 +4964,18 @@ var ga = class {
|
|
|
4964
4964
|
try {
|
|
4965
4965
|
if (!await this.ensureHostFonts(n) || !this.isCurrentSheetRequest(t, n)) return;
|
|
4966
4966
|
e !== this.currentSheet && this.currentWorksheet && (this.releaseCurrentWorksheet?.(), this.releaseCurrentWorksheet = null);
|
|
4967
|
-
let u = await
|
|
4967
|
+
let u = await Yn(n, e);
|
|
4968
4968
|
i = u.worksheet, a = u.release;
|
|
4969
4969
|
let d = () => this.isCurrentSheetRequest(t, n) ? !1 : (a?.(), a = void 0, !0);
|
|
4970
4970
|
if (d()) return;
|
|
4971
|
-
let f = u.partial, p = this.sheetViews.get(e), m = this.initialAnchorReferenceFor(n, e), h = m === void 0 ?
|
|
4971
|
+
let f = u.partial, p = this.sheetViews.get(e), m = this.initialAnchorReferenceFor(n, e), h = m === void 0 ? qe(i) : void 0, g = h !== void 0;
|
|
4972
4972
|
if (g && (p !== void 0 && !p.parseError || this.viewEdits.hasViewEdits(e))) throw Error(`XLSX viewer cannot establish the initial size of editAs="oneCell" anchors on sheet ${e} after view edits.`);
|
|
4973
4973
|
let _ = (t) => {
|
|
4974
4974
|
let n = t.parseError || p?.parseError ? void 0 : p, r = n ?? this.createVisibleSheetView(t);
|
|
4975
|
-
return (n || u.partial) && (r.rows = t.rows), n || (m && !t.parseError &&
|
|
4975
|
+
return (n || u.partial) && (r.rows = t.rows), n || (m && !t.parseError && Be(r, m), this.viewEdits.restoreSheetViewState(e, r)), r;
|
|
4976
4976
|
}, v = (r, i) => {
|
|
4977
|
-
i &&
|
|
4978
|
-
let a = n[
|
|
4977
|
+
i && ut(r);
|
|
4978
|
+
let a = n[Un];
|
|
4979
4979
|
if (typeof a == "function") {
|
|
4980
4980
|
let e = this.hostDocument.createElement("canvas").getContext("2d");
|
|
4981
4981
|
e && (a.call(n, r, e), l = !0);
|
|
@@ -4983,8 +4983,8 @@ var ga = class {
|
|
|
4983
4983
|
this.isCurrentSheetRequest(t, n) && this.viewEdits.syncAutomaticRowOverrides(e, r);
|
|
4984
4984
|
}, y = (e) => {
|
|
4985
4985
|
if (!g || e.parseError || !this.isCurrentSheetRequest(t, n)) return;
|
|
4986
|
-
let r =
|
|
4987
|
-
return r &&
|
|
4986
|
+
let r = ze(e, H(e), this.viewport.scale) ?? null;
|
|
4987
|
+
return r && Be(e, r), r;
|
|
4988
4988
|
};
|
|
4989
4989
|
if (r = _(i), u.partial) {
|
|
4990
4990
|
let e = {
|
|
@@ -4993,7 +4993,7 @@ var ga = class {
|
|
|
4993
4993
|
scale: this.viewport.scale
|
|
4994
4994
|
};
|
|
4995
4995
|
s = e;
|
|
4996
|
-
let t = () =>
|
|
4996
|
+
let t = () => H(r).visibleRange({
|
|
4997
4997
|
width: e.width,
|
|
4998
4998
|
height: e.height,
|
|
4999
4999
|
scale: e.scale,
|
|
@@ -5017,7 +5017,7 @@ var ga = class {
|
|
|
5017
5017
|
rows: n.range.row + n.range.rows - ((r.freezeRows ?? 0) > 0 ? 1 : n.range.row),
|
|
5018
5018
|
cols: n.range.col + n.range.cols - ((r.freezeCols ?? 0) > 0 ? 1 : n.range.col)
|
|
5019
5019
|
};
|
|
5020
|
-
if (this.previewFallbackReason =
|
|
5020
|
+
if (this.previewFallbackReason = er(r, l, a) ?? (g ? tr(r, o, a) : null), this.previewFallbackReason) {
|
|
5021
5021
|
if (i = await u.completion, d()) return;
|
|
5022
5022
|
f = !1, s = null, r = _(i), v(r, !0);
|
|
5023
5023
|
}
|
|
@@ -5025,11 +5025,11 @@ var ga = class {
|
|
|
5025
5025
|
} else v(r, !1), c = y(r);
|
|
5026
5026
|
o = f ? u.completion : null;
|
|
5027
5027
|
} catch (e) {
|
|
5028
|
-
if (a?.(), c &&
|
|
5028
|
+
if (a?.(), c && ct(c), !this.isCurrentSheetRequest(t, n)) return;
|
|
5029
5029
|
throw await this.restoreDisplayedWorksheetLease(n, t), e;
|
|
5030
5030
|
}
|
|
5031
5031
|
if (!this.isCurrentSheetRequest(t, n)) {
|
|
5032
|
-
a?.(), c &&
|
|
5032
|
+
a?.(), c && ct(c);
|
|
5033
5033
|
return;
|
|
5034
5034
|
}
|
|
5035
5035
|
this.selectionInput.clearSheetGestures(), this.viewEdits.restoreRowResizeRanges(e, r), c !== void 0 && this.installInitialAnchorReference(n, e, c), this.currentAutoRowHeightsPrepared = l, this.releaseCurrentWorksheet?.(), this.releaseCurrentWorksheet = a ?? null, this.sheetViews.clear(), this.sheetViews.set(e, r), this.currentSheet = e, this.displayedViewport = null, this.currentWorksheet = r, this.previewCompletion = o, this.firstPreviewRender = o !== null, this.previewPreparedViewport = s, o && o.then((i) => {
|
|
@@ -5038,13 +5038,13 @@ var ga = class {
|
|
|
5038
5038
|
let a = !!i.parseError;
|
|
5039
5039
|
this.selectionInput.clearSheetGestures();
|
|
5040
5040
|
let o = this.createVisibleSheetView(i), s = a ? void 0 : this.initialAnchorReferenceFor(n, e);
|
|
5041
|
-
if (s &&
|
|
5041
|
+
if (s && Be(o, s), this.viewEdits.restoreSheetViewState(e, o), this.displayedViewport = null, this.currentWorksheet = o, this.sheetViews.set(e, o), a) {
|
|
5042
5042
|
this.currentSourceComments = [], this.sourceCommentMap.clear(), this.selectionController.reset(), this.emitSelectionChange(), this.updateSelectionOverlay(), this.buildCommentMap(o), this.buildHyperlinkMap(o), this.buildOutline(o), this.layoutGutters(), this.updateSpacerSize(o), this.scheduleRender();
|
|
5043
5043
|
return;
|
|
5044
5044
|
}
|
|
5045
|
-
|
|
5045
|
+
at(r), ut(r);
|
|
5046
5046
|
let c = this.hostDocument.createElement("canvas").getContext("2d");
|
|
5047
|
-
c && (n[
|
|
5047
|
+
c && (n[Un](o, c), this.currentAutoRowHeightsPrepared = !0), this.viewEdits.syncAutomaticRowOverrides(e, o), this.currentSourceComments = i.comments ?? [], this.sourceCommentMap = Xi(this.currentSourceComments), this.buildCommentMap(o), this.buildHyperlinkMap(o), this.buildOutline(o), this.layoutGutters(), this.updateSpacerSize(o), this.scheduleRender(), this.scheduleSelectionContextNotification();
|
|
5048
5048
|
}).catch((e) => {
|
|
5049
5049
|
if (!(!this.isCurrentSheetRequest(t, n) || this.currentWorksheet !== r)) {
|
|
5050
5050
|
if (this.previewCompletion = null, this.firstPreviewRender = !1, this.previewPreparedViewport = null, this.selectionInput.clearSheetGestures(), this.displayedViewport = null, this.currentWorksheet = null, this.releaseCurrentWorksheet?.(), this.releaseCurrentWorksheet = null, this.renderDispatcher.begin(), this._mode === "worker") {
|
|
@@ -5075,12 +5075,12 @@ var ga = class {
|
|
|
5075
5075
|
this.initialAnchorWorkbook !== e && (this.releaseInitialAnchorReferences(), this.initialAnchorWorkbook = e), this.initialAnchorReferences.has(t) || this.initialAnchorReferences.set(t, n);
|
|
5076
5076
|
}
|
|
5077
5077
|
releaseInitialAnchorReferences() {
|
|
5078
|
-
for (let e of this.initialAnchorReferences.values()) e &&
|
|
5078
|
+
for (let e of this.initialAnchorReferences.values()) e && ct(e);
|
|
5079
5079
|
this.initialAnchorReferences.clear(), this.initialAnchorWorkbook = null;
|
|
5080
5080
|
}
|
|
5081
5081
|
async restoreDisplayedWorksheetLease(e, t) {
|
|
5082
5082
|
if (!this.currentWorksheet || this.releaseCurrentWorksheet) return;
|
|
5083
|
-
let n = await
|
|
5083
|
+
let n = await Xn(e, this.currentSheet);
|
|
5084
5084
|
this.isCurrentSheetRequest(t, e) && this.currentWorksheet && !this.releaseCurrentWorksheet ? this.releaseCurrentWorksheet = n : n();
|
|
5085
5085
|
}
|
|
5086
5086
|
buildOutline(e) {
|
|
@@ -5095,7 +5095,7 @@ var ga = class {
|
|
|
5095
5095
|
scrollOutlineSummaryToStart(e, t) {
|
|
5096
5096
|
let n = this.currentWorksheet;
|
|
5097
5097
|
if (!n) return;
|
|
5098
|
-
let r = this.viewport.scale, i =
|
|
5098
|
+
let r = this.viewport.scale, i = H(n).scrollOffsetForCell(e === "row" ? t : 1, e === "col" ? t : 1, {
|
|
5099
5099
|
scale: r,
|
|
5100
5100
|
viewportWidth: this.canvasArea.clientWidth,
|
|
5101
5101
|
viewportHeight: this.canvasArea.clientHeight,
|
|
@@ -5123,7 +5123,7 @@ var ga = class {
|
|
|
5123
5123
|
r && this.viewEdits.setBandCollapsed(r, this.currentSheet, e, t, n);
|
|
5124
5124
|
}
|
|
5125
5125
|
afterOutlineMutation(e, t) {
|
|
5126
|
-
|
|
5126
|
+
q.invalidate(e), this.outlineGutter.rebuild(e), this.updateSpacerSize(e), t && this.scrollOutlineSummaryToStart(t.axis, t.summary), this.updateSelectionOverlay(), this.updateFindOverlay(), this.scheduleRender(), t && this.emitViewportChange();
|
|
5127
5127
|
}
|
|
5128
5128
|
get isRtl() {
|
|
5129
5129
|
return this.currentWorksheet?.rightToLeft === !0;
|
|
@@ -5158,7 +5158,7 @@ var ga = class {
|
|
|
5158
5158
|
this.viewport.setOffset(e, this.viewport.y), this._nativeScrollbars && (this.scrollHost.scrollLeft = this.isRtl ? Math.max(0, this.maxScrollLeft - this.viewport.x) : this.viewport.x);
|
|
5159
5159
|
}
|
|
5160
5160
|
screenX(e, t) {
|
|
5161
|
-
return this.isRtl ?
|
|
5161
|
+
return this.isRtl ? bt(e, t, this.canvasArea.clientWidth) : e;
|
|
5162
5162
|
}
|
|
5163
5163
|
resetHorizontalScroll() {
|
|
5164
5164
|
this.viewport.setOffset(0, this.viewport.y), this._nativeScrollbars && (this.scrollHost.scrollLeft = this.isRtl ? this.maxScrollLeft : 0);
|
|
@@ -5212,14 +5212,14 @@ var ga = class {
|
|
|
5212
5212
|
this.reanchorHorizontalScroll(), this.layoutGutters(), this.currentWorksheet && this.updateSpacerSize(this.currentWorksheet), await this.renderCurrentSheet(), this.updateSelectionOverlay(), this.updateFindOverlay();
|
|
5213
5213
|
}
|
|
5214
5214
|
async scrollToCell(e, t = {}) {
|
|
5215
|
-
let n =
|
|
5215
|
+
let n = z(e);
|
|
5216
5216
|
!n || !this.currentWorksheet || (this.previewCompletion && await this.previewCompletion, this._scrollCellIntoView(n.row, n.col, t.align ?? "nearest"), await this.renderCurrentSheet(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.emitViewportChange());
|
|
5217
5217
|
}
|
|
5218
5218
|
_stepSheet(e) {
|
|
5219
|
-
return this._hiddenSheetMode === "skip" && this.wb ?
|
|
5219
|
+
return this._hiddenSheetMode === "skip" && this.wb ? Bt(this.currentSheet, e, (e) => this.wb.isHidden(e), this.sheetCount) : this.currentSheet + e;
|
|
5220
5220
|
}
|
|
5221
5221
|
_initialSheet() {
|
|
5222
|
-
return this._hiddenSheetMode === "skip" && this.wb ?
|
|
5222
|
+
return this._hiddenSheetMode === "skip" && this.wb ? Vt(0, (e) => this.wb.isHidden(e), this.sheetCount) : 0;
|
|
5223
5223
|
}
|
|
5224
5224
|
displayedViewportOffset() {
|
|
5225
5225
|
let e = this.displayedViewport;
|
|
@@ -5241,7 +5241,7 @@ var ga = class {
|
|
|
5241
5241
|
x: this.effectiveScrollLeft,
|
|
5242
5242
|
y: this.viewportTop
|
|
5243
5243
|
} : this.displayedViewportOffset();
|
|
5244
|
-
return
|
|
5244
|
+
return H(r).cellAt(u, d, {
|
|
5245
5245
|
scrollX: f.x,
|
|
5246
5246
|
scrollY: f.y,
|
|
5247
5247
|
scale: i
|
|
@@ -5252,7 +5252,7 @@ var ga = class {
|
|
|
5252
5252
|
if (!e) return null;
|
|
5253
5253
|
let t = this.canvasArea.clientWidth, n = this.canvasArea.clientHeight;
|
|
5254
5254
|
if (t <= 0 || n <= 0) return null;
|
|
5255
|
-
let r = this.viewport.scale, i =
|
|
5255
|
+
let r = this.viewport.scale, i = H(e).visibleRange({
|
|
5256
5256
|
width: t,
|
|
5257
5257
|
height: n,
|
|
5258
5258
|
scale: r,
|
|
@@ -5278,7 +5278,7 @@ var ga = class {
|
|
|
5278
5278
|
let n = this.currentWorksheet, r = this.elementContextViewport();
|
|
5279
5279
|
if (!n || !r) return null;
|
|
5280
5280
|
let i = this.canvasArea.getBoundingClientRect();
|
|
5281
|
-
return
|
|
5281
|
+
return hr(n, this.currentSheet, {
|
|
5282
5282
|
x: e - i.left,
|
|
5283
5283
|
y: t - i.top
|
|
5284
5284
|
}, r);
|
|
@@ -5287,7 +5287,7 @@ var ga = class {
|
|
|
5287
5287
|
let n = this.currentWorksheet;
|
|
5288
5288
|
if (!n) return null;
|
|
5289
5289
|
let r = this.viewport.scale;
|
|
5290
|
-
return
|
|
5290
|
+
return H(n).cellRect(e, t, {
|
|
5291
5291
|
scale: r,
|
|
5292
5292
|
scrollX: this.displayedViewportOffset().x,
|
|
5293
5293
|
scrollY: this.displayedViewportOffset().y,
|
|
@@ -5297,7 +5297,7 @@ var ga = class {
|
|
|
5297
5297
|
}
|
|
5298
5298
|
getCellViewportRect(e) {
|
|
5299
5299
|
if (this._destroyed) return null;
|
|
5300
|
-
let t = typeof e == "string" ?
|
|
5300
|
+
let t = typeof e == "string" ? z(e) : e;
|
|
5301
5301
|
if (!t || t.row < 1 || t.col < 1) return null;
|
|
5302
5302
|
let n = this._cellRect(t.row, t.col);
|
|
5303
5303
|
return n ? Object.freeze({
|
|
@@ -5311,12 +5311,12 @@ var ga = class {
|
|
|
5311
5311
|
return this.assertOpen(), structuredClone(this.currentSourceComments);
|
|
5312
5312
|
}
|
|
5313
5313
|
async goToComment(e, t, n) {
|
|
5314
|
-
let r =
|
|
5314
|
+
let r = z(t), i = this.wb;
|
|
5315
5315
|
if (!r || !i || !Number.isInteger(e) || e < 0 || e >= i.sheetCount) return !1;
|
|
5316
5316
|
let a = ++this.commentNavigationGeneration, o = e === this.currentSheet && this.currentWorksheet !== null ? this.currentSourceComments : await i.getComments(e);
|
|
5317
5317
|
if (this._destroyed) throw this.destroyedError();
|
|
5318
5318
|
if (a !== this.commentNavigationGeneration || i !== this.wb || !o.some((e) => {
|
|
5319
|
-
let t =
|
|
5319
|
+
let t = z(e.cellRef);
|
|
5320
5320
|
return t?.row === r.row && t.col === r.col;
|
|
5321
5321
|
})) return !1;
|
|
5322
5322
|
if (e !== this.currentSheet || this.currentWorksheet === null) {
|
|
@@ -5334,20 +5334,20 @@ var ga = class {
|
|
|
5334
5334
|
if (this._destroyed) throw Error("XlsxViewer has been destroyed");
|
|
5335
5335
|
let t;
|
|
5336
5336
|
if (typeof e == "string") {
|
|
5337
|
-
if (t =
|
|
5338
|
-
} else t = e ?
|
|
5337
|
+
if (t = Tr(e), !t) throw SyntaxError(`Invalid XLSX selection reference: ${e}`);
|
|
5338
|
+
} else t = e ? X(e) : null;
|
|
5339
5339
|
this.commitSelection(t);
|
|
5340
5340
|
}
|
|
5341
5341
|
getSelectionContext(e = {}) {
|
|
5342
5342
|
if (this.assertOpen(), this.previewCompletion) return null;
|
|
5343
|
-
if (this.elementContext) return
|
|
5343
|
+
if (this.elementContext) return gr(this.elementContext, e.maxTextCharacters);
|
|
5344
5344
|
let t = this.currentWorksheet, n = this.selectionState;
|
|
5345
5345
|
return !t || !n ? null : this.contextReader.read(t, this.currentSheet, n, this.sourceCommentMap, this.wb, e);
|
|
5346
5346
|
}
|
|
5347
5347
|
commitSelection(e) {
|
|
5348
5348
|
this.setElementContext(null);
|
|
5349
5349
|
let t = this.selectionState;
|
|
5350
|
-
|
|
5350
|
+
Er(t, e) || (this.hideValidationPanel(), this.selectionController.setState(e), this.updateSelectionOverlay(), this.wb && this.scheduleRender(), this.emitSelectionChange());
|
|
5351
5351
|
}
|
|
5352
5352
|
setElementContext(e) {
|
|
5353
5353
|
return JSON.stringify(this.elementContext) === JSON.stringify(e) ? !1 : (this.elementContext = e ? structuredClone(e) : null, this.updateSelectionOverlay(), this.scheduleSelectionContextNotification(), !0);
|
|
@@ -5361,8 +5361,8 @@ var ga = class {
|
|
|
5361
5361
|
refitAutoRowsAfterColumnResize() {
|
|
5362
5362
|
let e = this.currentWorksheet, t = this.preparedWorkbook;
|
|
5363
5363
|
if (!e || !t) return;
|
|
5364
|
-
|
|
5365
|
-
let n = t[
|
|
5364
|
+
ut(e, this.viewEdits.manualRows(this.currentSheet));
|
|
5365
|
+
let n = t[Un];
|
|
5366
5366
|
if (typeof n != "function") return;
|
|
5367
5367
|
let r = this.hostDocument.createElement("canvas").getContext("2d");
|
|
5368
5368
|
r && (n.call(t, e, r), this.viewEdits.syncAutomaticRowOverrides(this.currentSheet, e), this.updateSpacerSize(e), this.updateSelectionOverlay(), this.scheduleRender());
|
|
@@ -5371,7 +5371,7 @@ var ga = class {
|
|
|
5371
5371
|
this.opts.selectionColor = e, this.updateSelectionOverlay();
|
|
5372
5372
|
}
|
|
5373
5373
|
async setHiddenSheetMode(e) {
|
|
5374
|
-
this._hiddenSheetMode = e, this.buildTabs(), e === "skip" && this.wb && this.wb.isHidden(this.currentSheet) ? await this.showSheet(
|
|
5374
|
+
this._hiddenSheetMode = e, this.buildTabs(), e === "skip" && this.wb && this.wb.isHidden(this.currentSheet) ? await this.showSheet(Vt(this.currentSheet, (e) => this.wb.isHidden(e), this.sheetCount)) : this.updateTabActive(this.currentSheet);
|
|
5375
5375
|
}
|
|
5376
5376
|
get hiddenSheetMode() {
|
|
5377
5377
|
return this._hiddenSheetMode;
|
|
@@ -5379,7 +5379,7 @@ var ga = class {
|
|
|
5379
5379
|
get visibleSheetCount() {
|
|
5380
5380
|
if (!this.wb) return 0;
|
|
5381
5381
|
let e = this.wb;
|
|
5382
|
-
return
|
|
5382
|
+
return Ht((t) => e.isHidden(t), this.sheetCount);
|
|
5383
5383
|
}
|
|
5384
5384
|
async copySelection() {
|
|
5385
5385
|
return this.assertOpen(), this.previewCompletion && await this.previewCompletion, this.copier.copy();
|
|
@@ -5405,7 +5405,7 @@ var ga = class {
|
|
|
5405
5405
|
_scrollCellIntoView(e, t, n = "nearest") {
|
|
5406
5406
|
let r = this.currentWorksheet;
|
|
5407
5407
|
if (!r) return;
|
|
5408
|
-
let i = this.viewport.scale, a =
|
|
5408
|
+
let i = this.viewport.scale, a = H(r).scrollOffsetForCell(e, t, {
|
|
5409
5409
|
scale: i,
|
|
5410
5410
|
viewportWidth: this.canvasArea.clientWidth,
|
|
5411
5411
|
viewportHeight: this.canvasArea.clientHeight,
|
|
@@ -5431,7 +5431,7 @@ var ga = class {
|
|
|
5431
5431
|
commentRefs: [],
|
|
5432
5432
|
comments: []
|
|
5433
5433
|
};
|
|
5434
|
-
return
|
|
5434
|
+
return B(t, e), Bn(t, e), U(t, e), e;
|
|
5435
5435
|
}
|
|
5436
5436
|
if ((typeof this.opts.comments == "object" ? this.opts.comments : void 0)?.includeResolved !== !1) return t;
|
|
5437
5437
|
let n = new Set((t.comments ?? []).filter((e) => e.resolved === !0).map((e) => e.cellRef));
|
|
@@ -5441,7 +5441,7 @@ var ga = class {
|
|
|
5441
5441
|
commentRefs: t.commentRefs?.filter((e) => !n.has(e)),
|
|
5442
5442
|
comments: t.comments?.filter((e) => !n.has(e.cellRef))
|
|
5443
5443
|
};
|
|
5444
|
-
return
|
|
5444
|
+
return B(t, r), Bn(t, r), U(t, r), r;
|
|
5445
5445
|
}
|
|
5446
5446
|
buildHyperlinkMap(e) {
|
|
5447
5447
|
this.hyperlinks.build(e);
|
|
@@ -5461,8 +5461,8 @@ var ga = class {
|
|
|
5461
5461
|
if (this.viewport.setScale(i), this.zoomControl?.sync(i, r, t, n), this.currentWorksheet) {
|
|
5462
5462
|
let e = this.effectiveScrollLeft, t = this.viewportTop;
|
|
5463
5463
|
if (this.layoutGutters(), this.updateSpacerSize(this.currentWorksheet), o) {
|
|
5464
|
-
this.viewportTop =
|
|
5465
|
-
let n = this.screenX(o.x, 0), r = this.maxScrollLeft, s =
|
|
5464
|
+
this.viewportTop = ye(t, o.y, a, i, { maxScroll: this.maxScrollTop });
|
|
5465
|
+
let n = this.screenX(o.x, 0), r = this.maxScrollLeft, s = ye(e, n, a, i, { maxScroll: r });
|
|
5466
5466
|
this.setViewportLeft(s);
|
|
5467
5467
|
} else this.setViewportLeft(e);
|
|
5468
5468
|
}
|
|
@@ -5473,10 +5473,10 @@ var ga = class {
|
|
|
5473
5473
|
return this.viewport.scale;
|
|
5474
5474
|
}
|
|
5475
5475
|
zoomIn() {
|
|
5476
|
-
this.setScale(
|
|
5476
|
+
this.setScale(Ce(this.getScale()));
|
|
5477
5477
|
}
|
|
5478
5478
|
zoomOut() {
|
|
5479
|
-
this.setScale(
|
|
5479
|
+
this.setScale(Pe(this.getScale()));
|
|
5480
5480
|
}
|
|
5481
5481
|
fitWidth() {
|
|
5482
5482
|
this._fit("width");
|
|
@@ -5487,7 +5487,7 @@ var ga = class {
|
|
|
5487
5487
|
_fit(e) {
|
|
5488
5488
|
let t = this.currentWorksheet;
|
|
5489
5489
|
if (!t) return;
|
|
5490
|
-
let { width: n, height: r } = this._naturalContentExtent(t), i =
|
|
5490
|
+
let { width: n, height: r } = this._naturalContentExtent(t), i = Fe({
|
|
5491
5491
|
contentWidth: n,
|
|
5492
5492
|
contentHeight: r,
|
|
5493
5493
|
containerWidth: this.canvasArea.clientWidth,
|
|
@@ -5496,13 +5496,13 @@ var ga = class {
|
|
|
5496
5496
|
i <= 0 || this.setScale(i);
|
|
5497
5497
|
}
|
|
5498
5498
|
_naturalContentExtent(e) {
|
|
5499
|
-
let { maxRow: t, maxCol: n } =
|
|
5500
|
-
return
|
|
5499
|
+
let { maxRow: t, maxCol: n } = Vn(e, this.gridExtent);
|
|
5500
|
+
return H(e).logicalContentExtent(t, n, 50, 22);
|
|
5501
5501
|
}
|
|
5502
5502
|
updateSpacerSize(e) {
|
|
5503
|
-
let t = this.viewport.scale, { maxRow: n, maxCol: r } =
|
|
5503
|
+
let t = this.viewport.scale, { maxRow: n, maxCol: r } = Vn(e, this.gridExtent);
|
|
5504
5504
|
n += this.gridExtent.marginRows, r += this.gridExtent.marginCols;
|
|
5505
|
-
let i =
|
|
5505
|
+
let i = H(e).roundedContentExtent(n, r, t, 50, 22), a = i.width, o = i.height;
|
|
5506
5506
|
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;
|
|
5507
5507
|
}
|
|
5508
5508
|
scheduleRender(e = !1) {
|
|
@@ -5533,7 +5533,7 @@ var ga = class {
|
|
|
5533
5533
|
}
|
|
5534
5534
|
let t = this.currentWorksheet, n = this.canvasArea.clientWidth, r = this.canvasArea.clientHeight;
|
|
5535
5535
|
if (n <= 0 || r <= 0) return;
|
|
5536
|
-
let i = this.viewport.scale, a = this.surface.dpr, o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c = this.effectiveScrollLeft, l = this.viewportTop, u =
|
|
5536
|
+
let i = this.viewport.scale, a = this.surface.dpr, o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c = this.effectiveScrollLeft, l = this.viewportTop, u = H(t).visibleRange({
|
|
5537
5537
|
width: n,
|
|
5538
5538
|
height: r,
|
|
5539
5539
|
scale: i,
|
|
@@ -5560,10 +5560,10 @@ var ga = class {
|
|
|
5560
5560
|
revision: this.viewEdits.sizeRevision(this.currentSheet),
|
|
5561
5561
|
autoRowHeightsPrepared: this.currentAutoRowHeightsPrepared,
|
|
5562
5562
|
...v ? { initialAnchorSizes: v } : {}
|
|
5563
|
-
} : void 0, b =
|
|
5563
|
+
} : void 0, b = An(_ ? {
|
|
5564
5564
|
...g,
|
|
5565
5565
|
sizeOverrides: _.overrides
|
|
5566
|
-
} : g,
|
|
5566
|
+
} : g, H(t).maximumDigitWidth, {
|
|
5567
5567
|
worksheet: t,
|
|
5568
5568
|
projection: y
|
|
5569
5569
|
});
|
|
@@ -5578,7 +5578,7 @@ var ga = class {
|
|
|
5578
5578
|
width: n,
|
|
5579
5579
|
height: r
|
|
5580
5580
|
}, this.updateSelectionOverlay(), this.updateFindOverlay(), this._lastViewportNotification && this.emitViewportChange();
|
|
5581
|
-
} else if (await this.workbook.renderViewport(this.canvas, this.currentSheet, d,
|
|
5581
|
+
} else if (await this.workbook.renderViewport(this.canvas, this.currentSheet, d, nn(b, () => !this._destroyed && this.renderDispatcher.isCurrent(e))), !this.renderDispatcher.isCurrent(e) || this._destroyed) return;
|
|
5582
5582
|
this.renderGutters(), this.firstPreviewRender = !1, this.committedFrameCount++;
|
|
5583
5583
|
}
|
|
5584
5584
|
computeHeaderHighlight() {
|
|
@@ -5597,7 +5597,7 @@ var ga = class {
|
|
|
5597
5597
|
destroy() {
|
|
5598
5598
|
if (this._destroyed) return;
|
|
5599
5599
|
this._destroyed = !0, this.notifier.destroy(), this.selectionInput.destroy(), this.sheetRequestGeneration++, this.resizeObserver?.disconnect(), this.chromeTheme.destroy(), this.renderDispatcher.destroy(), this.surface.destroy(), this.overlayHost.destroy(), this.sheetTabs?.destroy(), this.zoomControl?.destroy(), this.comments.destroy(), this.validation.destroy(), this.finder.destroy(), this.releaseHostFonts();
|
|
5600
|
-
let e = this.wb?.[
|
|
5600
|
+
let e = this.wb?.[Wn];
|
|
5601
5601
|
typeof e == "function" && e.call(this.wb, this.projectionId), this.displayedViewport = null, this.currentWorksheet = null, this.releaseCurrentWorksheet?.(), this.releaseCurrentWorksheet = null, this.sheetViews.clear(), this.releaseInitialAnchorReferences(), this.viewEdits.destroy(), this.currentSourceComments = [], this.sourceCommentMap.clear(), this.hyperlinks.destroy(), this.preparedWorkbook = null, this.outlineGutter.destroy(), this.elementContext = null, this.selectionController.reset(), this.acquisition.destroy(), this.wrapper.remove();
|
|
5602
5602
|
}
|
|
5603
5603
|
assertOpen() {
|
|
@@ -5634,8 +5634,8 @@ var ga = class {
|
|
|
5634
5634
|
}
|
|
5635
5635
|
constructor(e, t = {}) {
|
|
5636
5636
|
this.canvasElement = e;
|
|
5637
|
-
let n = t[aa], r =
|
|
5638
|
-
this.canvasMount = new
|
|
5637
|
+
let n = t[aa], r = Me("XlsxSheetViewer", t.mode, n), i = e.getBoundingClientRect();
|
|
5638
|
+
this.canvasMount = new je(e, {
|
|
5639
5639
|
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`};`,
|
|
5640
5640
|
restoreMode: "style-and-bitmap"
|
|
5641
5641
|
}), this.engine = new ga(this.canvasMount.wrapper, {
|
|
@@ -5808,19 +5808,19 @@ var ga = class {
|
|
|
5808
5808
|
}
|
|
5809
5809
|
}, ya = /* @__PURE__ */ e({
|
|
5810
5810
|
MAX_SELECTION_AREAS: () => 128,
|
|
5811
|
-
MAX_SELECTION_CONTEXT_CELLS: () =>
|
|
5812
|
-
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () =>
|
|
5813
|
-
OoxmlDecodedImageLimitError: () =>
|
|
5811
|
+
MAX_SELECTION_CONTEXT_CELLS: () => vr,
|
|
5812
|
+
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () => yr,
|
|
5813
|
+
OoxmlDecodedImageLimitError: () => ce,
|
|
5814
5814
|
OoxmlError: () => t,
|
|
5815
5815
|
OoxmlResourceLimitError: () => g,
|
|
5816
|
-
TiffDecodeError: () =>
|
|
5816
|
+
TiffDecodeError: () => he,
|
|
5817
5817
|
XlsxSheetViewer: () => va,
|
|
5818
5818
|
XlsxViewer: () => _a,
|
|
5819
|
-
XlsxWorkbook: () =>
|
|
5820
|
-
autoResize: () =>
|
|
5821
|
-
isOoxmlDecodedImageLimitError: () =>
|
|
5822
|
-
isTiffDecodeError: () =>
|
|
5823
|
-
openExternalHyperlink: () =>
|
|
5824
|
-
resolveSharedStrings: () =>
|
|
5819
|
+
XlsxWorkbook: () => qn,
|
|
5820
|
+
autoResize: () => _e,
|
|
5821
|
+
isOoxmlDecodedImageLimitError: () => R,
|
|
5822
|
+
isTiffDecodeError: () => me,
|
|
5823
|
+
openExternalHyperlink: () => ie,
|
|
5824
|
+
resolveSharedStrings: () => wt
|
|
5825
5825
|
});
|
|
5826
|
-
export {
|
|
5826
|
+
export { vr as a, jn as c, _r as i, An as l, va as n, yr as o, _a as r, qn as s, ya as t };
|