@silurus/ooxml 0.87.0 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -23
- package/THIRD_PARTY_NOTICES.md +7 -6
- package/dist/abort-VrnK7mdP.js +10 -0
- package/dist/assets/render-worker-CUOU6mL2.js +16 -0
- package/dist/assets/render-worker-DOqrFhSU.js +15 -0
- package/dist/assets/render-worker-DvWUdZUN.js +35 -0
- package/dist/bounded-raw-part-cache-B7JoC1CD.js +64586 -0
- package/dist/bundled-asset-url-E2nXURF9.js +15 -0
- package/dist/canvas-viewer-mechanics-DfQqRKkD.js +675 -0
- package/dist/cfb-guard-9QTRTg7f.js +528 -0
- package/dist/chart-ex.mjs +708 -739
- package/dist/comment-overlay-controller-B5_zGgG5.js +994 -0
- package/dist/comment-ui-runtime-B7ZvovcS.js +2 -0
- package/dist/{comment-ui-runtime-DcJOYlw-.js → comment-ui-runtime-D_sb2K6s.js} +5 -5
- package/dist/{comment-ui-runtime-BfE7MJZn.js → comment-ui-runtime-Jy-3goA9.js} +5 -5
- package/dist/delimited-text-worker-host-CikWU6_m.js +27 -0
- package/dist/document-model-source-BKNrXjAL.js +249 -0
- package/dist/document-pull-client-CxONDGbk.js +37833 -0
- package/dist/document-pull-worker-AMyXYpPq.js +104 -0
- package/dist/docx-D91ER1_S.js +495 -0
- package/dist/docx-DhDnKEI6.js +3563 -0
- package/dist/docx-model-source-CdrSt3hF.js +98 -0
- package/dist/docx-source-worker.mjs +455 -0
- package/dist/docx.mjs +7 -7
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/drawingml-shape-ChcGZNd8.js +310 -0
- package/dist/duotone-ekYik4ix.js +126 -0
- package/dist/emf-UT6I8rVi.js +1790 -0
- package/dist/font-preload-demand-CdJZUMCT.js +2058 -0
- package/dist/grid-geometry-uQOgViJU.js +384 -0
- package/dist/host-layout-DVMw8hDY.js +56 -0
- package/dist/host-layout-measure-CCEgaC_v.js +7 -0
- package/dist/in-process-pull-transport-DuXcPZng.js +29 -0
- package/dist/index.mjs +4 -4
- package/dist/internal-companion.mjs +12 -0
- package/dist/line-distribute-CPOV6csk.js +2716 -0
- package/dist/math.mjs +2 -2
- package/dist/mathjax-stix2.js +10 -10
- package/dist/model-source-DJGzDtGb.js +61 -0
- package/dist/model-source-kz_NkZqT.js +179 -0
- package/dist/model-source-session-Bu9CHFHc.js +71 -0
- package/dist/model-source-session-CDuijwv1.js +85 -0
- package/dist/model-source-session-sKpNiIJI.js +58 -0
- package/dist/node.mjs +7 -1327
- package/dist/{pixel-budget-Dgjw269h.js → pixel-budget-BpTYrepD.js} +13 -10
- package/dist/plot-area-frame-CaJFvZ7p.js +8502 -0
- package/dist/pptx-CDP9dZHe.js +2936 -0
- package/dist/pptx-C_uxLVKB.js +183 -0
- package/dist/pptx-model-source-O7LhpOjz.js +37 -0
- package/dist/pptx-source-worker.mjs +446 -0
- package/dist/pptx.mjs +8 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/presentation-model-source-tmROzteR.js +77 -0
- package/dist/raster-target-YQ4G6rxo.js +42 -0
- package/dist/region-map.mjs +114 -150
- package/dist/{render-8Zo7dnds.js → render-CJVglUHl.js} +3 -3
- package/dist/{render-worker-host-BfbnEChF.js → render-worker-host-BseIaVvm.js} +1 -1
- package/dist/{render-worker-host-DNL9dWRh.js → render-worker-host-CyxPU4JU.js} +1 -1
- package/dist/{render-worker-host-IkHrYOci.js → render-worker-host-aF6aWkC0.js} +1 -1
- package/dist/renderer-CkGLj0CC.js +5170 -0
- package/dist/renderer-Czw1cCC7.js +5823 -0
- package/dist/resource-measurement-mXw-WjMF.js +771 -0
- package/dist/session-Csv9maad.js +656 -0
- package/dist/slide-pull-client-DRZYwBTu.js +6515 -0
- package/dist/three-d-BK5siJgJ.js +878 -0
- package/dist/three-d.mjs +871 -764
- package/dist/{raster-target-ojDdQizC.js → tiff-contract-C6M3QcPp.js} +1 -42
- package/dist/tiff.mjs +401 -248
- package/dist/types/chart-ex.d.ts +289 -4
- package/dist/types/docx.d.ts +473 -98
- package/dist/types/index.d.ts +674 -303
- package/dist/types/internal-companion.d.ts +11 -0
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +530 -11
- package/dist/types/pptx.d.ts +410 -97
- package/dist/types/region-map.d.ts +289 -4
- package/dist/types/three-d.d.ts +289 -4
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +483 -134
- package/dist/wasm-loader-rlgHmcSv.js +35 -0
- package/dist/wasm-runtime-generation-DX4y0Ecl.js +97 -0
- package/dist/workbook-model-source-BTC4ISTS.js +94 -0
- package/dist/worker-source-I1cIYBel.js +22 -0
- package/dist/worker-source-SbudzjYL.js +22 -0
- package/dist/worker-source-UAi3GNcM.js +22 -0
- package/dist/worksheet-pull-client-CkHgbtyM.js +579 -0
- package/dist/xlsx-CpSDPAEU.js +5809 -0
- package/dist/xlsx-D5569TPf.js +534 -0
- package/dist/xlsx-model-source-DPSkjFic.js +309 -0
- package/dist/xlsx-source-worker.mjs +525 -0
- package/dist/xlsx.mjs +8 -7
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +42 -16
- package/dist/assets/render-worker-CeK_iqK3.js +0 -10
- package/dist/assets/render-worker-DusrDhPk.js +0 -11
- package/dist/assets/render-worker-n2ZG0lrQ.js +0 -31
- package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +0 -119
- package/dist/canvas-viewer-mechanics-Cpk0YFvM.js +0 -1384
- package/dist/cjk-fallback-bLI3z70h.js +0 -46
- package/dist/comment-occurrence-C8Y2uoVr.js +0 -6
- package/dist/comment-ui-runtime-BsK8pmUT.js +0 -2
- package/dist/comments-Diid5ujN.js +0 -246
- package/dist/delimited-text-worker-host-BVY-Ecni.js +0 -27
- package/dist/document-pull-client-yKxI8aDH.js +0 -27251
- package/dist/docx-BkSRiy07.js +0 -2995
- package/dist/dom-interaction-boundary-CBUQJsIM.js +0 -223
- package/dist/highlight-rect-C5hkRqUr.js +0 -13
- package/dist/hyperlink-ArrU3ArU.js +0 -36447
- package/dist/line-distribute-Dtudnqhs.js +0 -1023
- package/dist/line-metrics-B60C86uh.js +0 -60
- package/dist/plot-area-frame-D5hEOgkJ.js +0 -2903
- package/dist/pptx-62MmVbYB.js +0 -3063
- package/dist/renderer-XFSCOT6m.js +0 -5857
- package/dist/resource-measurement-CJsgolre.js +0 -150
- package/dist/session-CrU8f8DI.js +0 -743
- package/dist/slide-pull-client-B9KA8bU6.js +0 -6253
- package/dist/source-key-DIJG8BA0.js +0 -42
- package/dist/three-d-YYghQndN.js +0 -1346
- package/dist/transfer-p6iCC2R7.js +0 -6
- package/dist/units-EJdC96r6.js +0 -4
- package/dist/worksheet-pull-client-eIcQ-xlD.js +0 -458
- package/dist/xlsx-CRcSzZNq.js +0 -8482
- /package/dist/{chunk-DmhlhrBa.js → chunk-Dy4uBu1J.js} +0 -0
- /package/dist/{mathjax-DoyWZbSp.js → mathjax-BhwN6ilc.js} +0 -0
- /package/dist/{read-only-comment-decoration-Dz7eTQ4d.js → read-only-comment-decoration-PidH0wnP.js} +0 -0
- /package/dist/{read-only-comment-margin-DkgzASAl.js → read-only-comment-margin-B52rDVKo.js} +0 -0
- /package/dist/{renderer-module-contract-D91rkYHH.js → renderer-module-contract-CWM7jv6d.js} +0 -0
- /package/dist/{visible-index-BgiHEc1z.js → visible-index-FeVA0mGE.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n } from "./
|
|
4
|
-
import { i as r, n as i, o as a, r as o, s, t as c } from "./read-only-comment-margin-
|
|
5
|
-
import { i as l, n as u, r as d, t as f } from "./read-only-comment-decoration-
|
|
1
|
+
import { E as e } from "./comment-overlay-controller-B5_zGgG5.js";
|
|
2
|
+
import { L as t } from "./document-pull-client-CxONDGbk.js";
|
|
3
|
+
import { f as n } from "./docx-DhDnKEI6.js";
|
|
4
|
+
import { i as r, n as i, o as a, r as o, s, t as c } from "./read-only-comment-margin-B52rDVKo.js";
|
|
5
|
+
import { i as l, n as u, r as d, t as f } from "./read-only-comment-decoration-PidH0wnP.js";
|
|
6
6
|
//#region packages/docx/src/comment-margin.ts
|
|
7
7
|
function p(e, r) {
|
|
8
8
|
let i = /* @__PURE__ */ new Set();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
import { i as r, n as i, o as a, r as o, t as s } from "./read-only-comment-margin-
|
|
5
|
-
import { i as c, n as l, r as u, t as d } from "./read-only-comment-decoration-
|
|
1
|
+
import { xa as e } from "./plot-area-frame-CaJFvZ7p.js";
|
|
2
|
+
import { E as t } from "./comment-overlay-controller-B5_zGgG5.js";
|
|
3
|
+
import { r as n } from "./pptx-CDP9dZHe.js";
|
|
4
|
+
import { i as r, n as i, o as a, r as o, t as s } from "./read-only-comment-margin-B52rDVKo.js";
|
|
5
|
+
import { i as c, n as l, r as u, t as d } from "./read-only-comment-decoration-PidH0wnP.js";
|
|
6
6
|
//#region packages/pptx/src/comment-margin.ts
|
|
7
7
|
function f(e, t, n) {
|
|
8
8
|
return {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region packages/xlsx/src/delimited-text-worker.ts?worker&inline
|
|
2
|
+
var e = "var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t,n,r=e((()=>{t=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)}},n=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 i(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 a(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function o(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,r=t.metric,o=t.limit,s=t.observed;return n!==`ooxml-decoded-image-limit`||!i(r)||!a(o)||!a(s)||s<=o?void 0:{metric:r,limit:o,observed:s}}catch{return}}var s,c,l,u,d,f=e((()=>{s=1<<25,c=1<<27,s*4,c*4,l=Math.floor(s/4),u=c,u/l,d=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 p(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 m=e((()=>{}));function h(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function g(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return h(t.requiredBytes)&&h(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var _=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 v(e){if(e instanceof _)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`||!g(r)))return new _(r)}r(),f(),m();const y=`OOXML_RESOURCE_LIMIT:`;function b(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function x(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return b(t.archiveEntryCount)&&b(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||b(t.largestInflatedEntryBytes))&&b(t.distinctInflatedBytes)&&b(t.operationInflatedBytes)}function S(e){return e===`docx`||e===`xlsx`||e===`pptx`}function ee(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function C(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function w(e){return C(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function T(e){return!C(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 E=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}]]),D=new Set([...E.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),O=new Set([...E.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function k(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!S(t.format)||!C(t.operation,256)||!w(t.resource)||!w(t.metric)||!b(t.limit)||!b(t.observed)||typeof t.configurable!=`boolean`||!x(t.usage)?!1:!(`part`in t)||T(t.part)}function A(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!ee(t.stage)||!k(t.violation))return!1;let n=t.violation,r=E.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:!(D.has(n.resource)&&O.has(n.metric))}function j(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function M(e){if(!A(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:j(t.usage)}};return A(n)?n:void 0}function N(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 P(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(y))return;let r;try{r=JSON.parse(t.slice(21))}catch{return}if(!r||typeof r!=`object`)return;let i=r;if(!(i.code!==`ooxml-resource-limit`||!A(i.details)))return new n(N(i.details),i.details)}function F(e){let n=e instanceof Error?e.message:String(e);if(n.startsWith(`OOXML_NOT_OOXML:`))return new t(`not-ooxml`,`This file is not an Office Open XML document: ${n.slice(16)}`)}function I(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.format,r=t.reason;if(!(!w(n)||r!==`source-subset`))return{format:n,reason:r}}function L(e){return new t(`unsupported-content`,`Input is outside the source’s supported subset.`,e)}function te(e){let t=typeof e==`string`?e:e instanceof Error?e.message:``;if(!(!t.startsWith(`MODEL_SOURCE_UNSUPPORTED:`)||t.length>1024))try{let e=I(JSON.parse(t.slice(25)));return e?L(e):void 0}catch{return}}function ne(e){return e===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`||e instanceof Error&&e.message===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`?new t(`unsupported-encryption`,`The configured source cannot decrypt this input.`):te(e)??P(e)??F(e)}function re(e){let r=o(e);if(r){let e=new d(r.metric,r.limit,r.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:r}}let i=p(e);if(i)return{message:i.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let a=v(e);if(a)return{message:a.message,errorName:a.name,code:a.code,insufficientCredit:{requiredBytes:a.requiredBytes,offeredBytes:a.offeredBytes}};let s=e instanceof t||e instanceof n?e:ne(e),c=s??e;if(s instanceof n||c&&typeof c==`object`&&c.code===`ooxml-resource-limit`){let e=c,t=M(e.details);return t?{message:typeof e.message==`string`?e.message:N(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=I(c.details);return e?{message:L(e).message,code:`unsupported-content`,unsupportedContent:e}:{message:`Invalid unsupported-content error payload`,errorName:`Error`}}if(s instanceof t)return{message:typeof s.message==`string`?s.message:String(s.message),errorName:C(s.name,128)?s.name:`OoxmlError`,...w(s.code)?{code:s.code}:{}};let l=e instanceof Error?e.message:String(e);if(typeof l==`string`&&l.startsWith(y))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let u=e instanceof Error?e:Error(l),f=u;return{message:typeof u.message==`string`?u.message:String(u.message),errorName:C(u.name,128)?u.name:`Error`,...typeof f.code==`string`?{code:f.code}:{}}}function R(e){try{return re(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}const z=2**53-1-1;function B(e){return Object.freeze({maxRows:e.maxRows,maxCells:e.maxCells,maxOwnedUtf8Bytes:e.maxOwnedUtf8Bytes,maxJsonBytes:e.maxJsonBytes})}const V=Object.freeze({worksheet:B({maxRows:1e5,maxCells:25e4,maxOwnedUtf8Bytes:33554432,maxJsonBytes:67108864}),cache:B({maxRows:2e5,maxCells:5e5,maxOwnedUtf8Bytes:67108864,maxJsonBytes:134217728}),maxCoordinateIndexEntries:25e4});function H(e,t){let n=e[t];if(n===void 0)return V.worksheet[t];if(typeof n!=`number`)throw TypeError(`xlsxWorksheetLimits.${t} must be a number`);if(!Number.isSafeInteger(n)||n<=0||n>z)throw RangeError(`xlsxWorksheetLimits.${t} must be a positive safe integer no greater than ${z}`);return n}function U(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=B({maxRows:H(n,`maxRows`),maxCells:H(n,`maxCells`),maxOwnedUtf8Bytes:H(n,`maxOwnedUtf8Bytes`),maxJsonBytes:H(n,`maxJsonBytes`)}),i=V,a=B({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 W(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function G(e,t,n){return W(e,`resource measurement`),W(t,`resource measurement`),W(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function K(e,t=2**53-1){W(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=G(n,a,t),n>t)return n}return n}function q(e,t=2**53-1){W(t,`resource measurement limit`);let n=G(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=G(n,a,t),n>t)return n}return n}function J(e,t){return G(0,e,t)}function Y(e,t=2**53-1,n=!1){if(W(t,`resource measurement limit`),e===null)return{jsonBytes:J(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:q(e,t),stringValueUtf8Bytes:K(e,t)};if(typeof e==`boolean`)return{jsonBytes:J(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:J((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=J(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=G(n,1,t));let a=Y(e[i],t,!0);n=G(n,a.jsonBytes,t),r=G(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=J(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=G(n,1,t)),n=G(n,q(a,t),t),n=G(n,1,t);let e=Y(o,t);n=G(n,e.jsonBytes,t),r=G(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?J(4,t):0,stringValueUtf8Bytes:0}}const ie=new WeakMap;function ae(e,t){ie.set(e,t)}r();const oe=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function se(e,t=V){let{maxCells:n,maxOwnedUtf8Bytes:r}=t.worksheet,i=e.reduce((e,t)=>G(e,t.cells.length,n),0);return{rows:e.length,cells:i,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=Y(t.value,r).stringValueUtf8Bytes;return G(e,G(n,t.formula===void 0?0:K(t.formula,r),r),r)},e),0)}}function X(e,t=V){return ce(e,se(e.rows,t),t)}function ce(e,t,n=V){let r=Y(e,n.worksheet.maxJsonBytes);return{...t,jsonBytes:r.jsonBytes}}function Z(e,t,r,i,a,o,s,c=r!==`delimited-text-source`){let l=r===`worksheet-json`?`serialization`:`parsing`;return new n(N({stage:l,violation:{part:t,resource:r,metric:i,observed:o,limit:a}}),{stage:l,violation:{format:`xlsx`,operation:e,resource:r,metric:i,...t===void 0?{}:{part:t},limit:a,observed:Math.min(o,a+1),configurable:c,usage:s??oe}})}function le(e,t,n,r,i=V){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 Z(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,a,i,r)}function ue(e,t,n,r,i=V){let a=i.worksheet.maxJsonBytes;if(e>a)throw Z(t,n,`worksheet-json`,`bytes`,a,e,r)}const Q=`load-delimited-text`,$=67108864;function de(e){if(e>$)throw Z(Q,void 0,`delimited-text-source`,`bytes`,$,e)}const fe=Object.freeze({fonts:[Object.freeze({bold:!1,italic:!1,underline:!1,strike:!1,size:11,color:null,name:`Calibri`})],fills:[Object.freeze({patternType:`none`,fgColor:null,bgColor:null})],borders:[Object.freeze({left:null,right:null,top:null,bottom:null})],cellXfs:[Object.freeze({fontId:0,fillId:0,borderId:0,numFmtId:0,alignH:null,alignV:null,wrapText:!1})],numFmts:[],dxfs:[]});function pe(e,t,n=V){de(e.byteLength);let r=n.worksheet,i;try{i=new TextDecoder(t.encoding,{fatal:!0}).decode(e)}catch(e){throw TypeError(`Delimited text could not be decoded as ${t.encoding}`,{cause:e})}let a=[],o=[],s=``,c,l=1,u=1,d=0,f=0,p=!1,m=!1,h=e=>{s+=e,s.length>=4096&&((c??=[]).push(s),s=``)},g=()=>{if(d=G(d,1,r.maxCells),d>r.maxCells)throw Z(Q,void 0,`worksheet-model`,`cells`,r.maxCells,d);if(u>16384)throw RangeError(`Delimited text row ${l} has more than 16384 columns`);let e=c?c.join(``)+s:s;if(e!==``){let t=r.maxOwnedUtf8Bytes;if(f=G(G(f,4,t),K(e,t+1),t),f>t)throw Z(Q,void 0,`worksheet-cell-content`,`owned-utf8-bytes`,t,f);o.push({row:l,col:u,value:{type:`text`,text:e}})}s=``,c=void 0,u++,m=!1},_=()=>{if(l>r.maxRows)throw Z(Q,void 0,`worksheet-model`,`rows`,r.maxRows,l);a.push({index:l,height:null,cells:o}),o=[],l++,u=1};for(let e=0;e<i.length;e++){let n=i[e];if(p){if(n!==`\"`){n===`\\r`?(h(`\n`),i[e+1]===`\n`&&e++):h(n);continue}i[e+1]===`\"`?(h(`\"`),e++):(p=!1,m=!0);continue}if(m){if(n!==t.delimiter&&n!==`\\r`&&n!==`\n`)throw SyntaxError(`Unexpected character after closing quote at row ${l}, column ${u}`)}else if(n===`\"`&&s===``&&c===void 0){p=!0;continue}if(n===t.delimiter){g();continue}if(n===`\\r`||n===`\n`){g(),_(),n===`\\r`&&i[e+1]===`\n`&&e++;continue}h(n)}if(p)throw SyntaxError(`Unterminated quoted field at row ${l}, column ${u}`);let v=i.endsWith(`\n`)||i.endsWith(`\\r`);i.length>0&&!v&&(g(),_());let y={name:t.sheetName,rows:a,colWidths:{},rowHeights:{},defaultColWidth:8.43,defaultRowHeight:15,mergeCells:[],freezeRows:0,freezeCols:0,conditionalFormats:[],images:[],charts:[],defaultFontFamily:`Calibri`,defaultFontSize:11},b=X(y,n);return le(b,Q,void 0,void 0,n),ue(b.jsonBytes,Q,void 0,void 0,n),ae(y,n),{workbook:{workbook:{sheets:[{name:t.sheetName,sheetId:1,rId:`rId1`}]},styles:fe,sharedStrings:[]},worksheet:y}}self.onmessage=e=>{let t=e.data;try{let e=U({xlsxWorksheetLimits:t.worksheetPolicy?.worksheet}),{workbook:n,worksheet:r}=pe(t.data,t.options,e),i=new TextEncoder().encode(JSON.stringify(r)).buffer,a={type:`delimitedTextParsed`,id:t.id,workbook:n,worksheetJson:i};self.postMessage(a,[i])}catch(e){let n={type:`error`,id:t.id,...R(e)};self.postMessage(n)}};", t = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", e], { type: "text/javascript;charset=utf-8" });
|
|
3
|
+
function n(n) {
|
|
4
|
+
let r;
|
|
5
|
+
try {
|
|
6
|
+
if (r = t && (self.URL || self.webkitURL).createObjectURL(t), !r) throw "";
|
|
7
|
+
let e = new Worker(r, {
|
|
8
|
+
type: "module",
|
|
9
|
+
name: n?.name
|
|
10
|
+
});
|
|
11
|
+
return e.addEventListener("error", () => {
|
|
12
|
+
(self.URL || self.webkitURL).revokeObjectURL(r);
|
|
13
|
+
}), e;
|
|
14
|
+
} catch {
|
|
15
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(e), {
|
|
16
|
+
type: "module",
|
|
17
|
+
name: n?.name
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region packages/xlsx/src/delimited-text-worker-host.ts
|
|
23
|
+
function r() {
|
|
24
|
+
return new n();
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { r as createDelimitedTextWorker };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { F as e, N as t, Un as n, Wn as r, cn as i, dn as a } from "./bounded-raw-part-cache-B7JoC1CD.js";
|
|
2
|
+
import { P as o, b as s } from "./comment-overlay-controller-B5_zGgG5.js";
|
|
3
|
+
import { N as c, _ as l, a as u, d, f, j as p, l as m, o as h, p as g, s as _, v, y } from "./document-pull-client-CxONDGbk.js";
|
|
4
|
+
import { _ as b, c as x, g as S, h as C, l as w, m as T, u as E } from "./docx-DhDnKEI6.js";
|
|
5
|
+
import { T as D } from "./canvas-viewer-mechanics-DfQqRKkD.js";
|
|
6
|
+
import { n as O } from "./renderer-module-contract-CWM7jv6d.js";
|
|
7
|
+
import { n as k, o as A, r as j } from "./model-source-kz_NkZqT.js";
|
|
8
|
+
import { t as M } from "./bundled-asset-url-E2nXURF9.js";
|
|
9
|
+
//#region packages/docx/src/internal/document-model-source.ts
|
|
10
|
+
function N(e) {
|
|
11
|
+
let t = M(new URL("./docx-source-worker.mjs", import.meta.url).href, import.meta.url);
|
|
12
|
+
return e.transfer.length > 0 ? {
|
|
13
|
+
source: e.module,
|
|
14
|
+
sourceTransfer: e.transfer,
|
|
15
|
+
sourceOwnerUrl: t
|
|
16
|
+
} : {
|
|
17
|
+
source: e.module,
|
|
18
|
+
sourceOwnerUrl: t
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function P(e, t) {
|
|
22
|
+
if (t === void 0) return;
|
|
23
|
+
let n = c(e), r = n.activeLayoutOptions;
|
|
24
|
+
if (!r || r.showTrackedChanges === !0 === t) return;
|
|
25
|
+
let i = p(r.currentDateMs, n.defaultCurrentDateMs, t);
|
|
26
|
+
n.activeLayoutOptions = i, e._progressive && (e._progressive.layoutOptions = i);
|
|
27
|
+
}
|
|
28
|
+
async function F(j, M = {}, N) {
|
|
29
|
+
let F = N?.signal, L = () => {
|
|
30
|
+
if (F?.aborted) throw new y();
|
|
31
|
+
};
|
|
32
|
+
L();
|
|
33
|
+
let R = i(M.cjkFallback), z = e(M), B = Date.now(), V = M.mode ?? "main", H = new t({
|
|
34
|
+
enabled: !0,
|
|
35
|
+
format: "docx",
|
|
36
|
+
mode: V,
|
|
37
|
+
policy: z.policy,
|
|
38
|
+
onMetrics: z.onResourceMetrics,
|
|
39
|
+
emitToConsole: z.debug
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
if (V === "worker" && (typeof Worker > "u" || typeof OffscreenCanvas > "u")) throw Error("mode: 'worker' requires Worker and OffscreenCanvas support");
|
|
43
|
+
let e;
|
|
44
|
+
if (typeof j == "string") {
|
|
45
|
+
let t = await fetch(j, { signal: F });
|
|
46
|
+
if (!t.ok) throw Error(`Failed to fetch: ${t.status} ${t.statusText}`);
|
|
47
|
+
e = await t.arrayBuffer();
|
|
48
|
+
} else e = j;
|
|
49
|
+
L();
|
|
50
|
+
let t = A(M.legacyDoc === void 0 ? void 0 : [M.legacyDoc], "docx", new Uint8Array(e));
|
|
51
|
+
if (!t) return x.load(e, {
|
|
52
|
+
...M,
|
|
53
|
+
legacyDoc: void 0
|
|
54
|
+
});
|
|
55
|
+
let i = k(t, "docx");
|
|
56
|
+
try {
|
|
57
|
+
H.setSourceBytes(e.byteLength), H.checkpoint("container ready");
|
|
58
|
+
let t = V === "worker" ? (await import("./render-worker-host-aF6aWkC0.js")).createRenderWorker() : new (await (import("./worker-source-SbudzjYL.js"))).default(), k, A, j = !1, U = () => {
|
|
59
|
+
j || !k || (j = !0, k.destroy());
|
|
60
|
+
}, W = I(t, i, M, (e) => {
|
|
61
|
+
k && P(k, e);
|
|
62
|
+
}), G = V === "worker" ? O(M) : void 0, K = V === "worker" && !!M.progressiveLayout;
|
|
63
|
+
try {
|
|
64
|
+
A = Reflect.construct(x, [
|
|
65
|
+
W,
|
|
66
|
+
V,
|
|
67
|
+
B,
|
|
68
|
+
M.wasmUrl
|
|
69
|
+
]), k = A, F?.addEventListener("abort", U, { once: !0 }), L(), k._metrics = H, k._cjkFallback = R, k._allowFootnoteContinuation = M.allowFootnoteContinuation !== !1;
|
|
70
|
+
let t = c(k), D = p(M.currentDate, t.defaultCurrentDateMs, M.showTrackedChanges === !0);
|
|
71
|
+
t.activeLayoutOptions = D, await k._parse(e, z.policy, V === "worker" ? !!M.useGoogleFonts : !1, M.workerTimeoutMs, (e) => H.observeUsage(e), G, K ? {
|
|
72
|
+
onPartial: M.onLayoutPartial,
|
|
73
|
+
onComplete: M.onLayoutComplete,
|
|
74
|
+
onProgress: M.onLayoutProgress,
|
|
75
|
+
layoutOptions: D,
|
|
76
|
+
abort: new AbortController(),
|
|
77
|
+
firstPublication: s(),
|
|
78
|
+
published: !1,
|
|
79
|
+
settled: !1
|
|
80
|
+
} : void 0), V === "worker" && k._mode === "main" && (H.setMode("main"), console.warn(C(k._mainThreadFallbackReason))), M.math && k._mode === "worker" && !G?.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."), M.threeD && k._mode === "worker" && !G?.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."), k._threeD = k._mode === "worker" ? void 0 : M.threeD, M.regionMap && k._mode === "worker" && !G?.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."), k._regionMap = k._mode === "worker" ? void 0 : M.regionMap, M.chartEx && k._mode === "worker" && !G?.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."), k._chartEx = k._mode === "worker" ? void 0 : M.chartEx, M.tiff && k._mode === "worker" && !G?.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."), k._tiff = k._mode === "worker" ? void 0 : M.tiff;
|
|
81
|
+
let O, j;
|
|
82
|
+
if (k._mode === "main" && k._document?.embeddedFonts?.length) {
|
|
83
|
+
let e = k, t = await T(k._document, (t) => e.getFontBytes(t));
|
|
84
|
+
if (F?.aborted) throw o(t.faces), new y();
|
|
85
|
+
S(k, t.diagnostics), k._embeddedFontFaces = t.faces, O = t.metrics, j = t.routes;
|
|
86
|
+
}
|
|
87
|
+
let P = k._mode === "main" && k._document ? await b(g(k._document, {
|
|
88
|
+
useGoogleFonts: M.useGoogleFonts,
|
|
89
|
+
cjkFallback: R
|
|
90
|
+
}).filter((e) => e.presenceOnly || !j?.some((t) => t.requestedFamily.toLowerCase() === e.family.toLowerCase() && t.weight === (e.weight ?? 400) && t.style === (e.style ?? "normal")))) : {
|
|
91
|
+
faces: [],
|
|
92
|
+
routes: {}
|
|
93
|
+
};
|
|
94
|
+
if (F?.aborted) throw a(P.faces), new y();
|
|
95
|
+
k._officeFontFaces = P.faces;
|
|
96
|
+
let I = [];
|
|
97
|
+
if (k._mode === "main" && M.useGoogleFonts && k._document) {
|
|
98
|
+
let e = f(k._document, R, P);
|
|
99
|
+
I = e.installedSubstituteFamilies;
|
|
100
|
+
let t = await n(e.names, l);
|
|
101
|
+
if (F?.aborted) throw r(t), new y();
|
|
102
|
+
k._googleFontFaces = t;
|
|
103
|
+
}
|
|
104
|
+
let q;
|
|
105
|
+
if (k._mode === "main" && M.math && k._document && h(k._document) && (q = await _(k._document, M.math)), L(), k._mode === "main" && k._document && k._source) {
|
|
106
|
+
let e = k, t = c(k), n = {
|
|
107
|
+
allowFootnoteContinuation: k._allowFootnoteContinuation,
|
|
108
|
+
fontMetrics: O,
|
|
109
|
+
useGoogleFonts: !!M.useGoogleFonts,
|
|
110
|
+
cjkFallback: R,
|
|
111
|
+
embeddedRoutes: j,
|
|
112
|
+
officeRoutes: Object.values(P.routes),
|
|
113
|
+
googleFaces: k._googleFontFaces,
|
|
114
|
+
installedSubstituteFamilies: I,
|
|
115
|
+
installedFamilies: "installed" in P ? P.installed : void 0,
|
|
116
|
+
mathResources: q?.records,
|
|
117
|
+
mathDrawables: q?.drawables
|
|
118
|
+
}, r = await d(k._source, k._document, {
|
|
119
|
+
useGoogleFonts: !!M.useGoogleFonts,
|
|
120
|
+
cjkFallback: R
|
|
121
|
+
});
|
|
122
|
+
if (F?.aborted) throw a(r.faces), new y();
|
|
123
|
+
k._officeFontFaces = [...k._officeFontFaces, ...r.faces], t.services = m(k._source, {
|
|
124
|
+
...n,
|
|
125
|
+
nativeRouteMetrics: r.nativeRouteMetrics
|
|
126
|
+
});
|
|
127
|
+
let i = t.services, o = u(k._source, i, t.defaultCurrentDateMs), l = k._source.fatalParse === null, f = t.activeLayoutOptions;
|
|
128
|
+
if (!f) throw Error("Active layout view was not recorded at load");
|
|
129
|
+
let h = { onProgress: M.onLayoutProgress ? (t) => e._layoutObservers.notify("onLayoutProgress", M.onLayoutProgress, { committedUnits: t }) : void 0 };
|
|
130
|
+
if (l && M.progressiveLayout) {
|
|
131
|
+
let e = o.layoutVariants, t = k, n = new AbortController();
|
|
132
|
+
t._layoutAbort = n;
|
|
133
|
+
let r = s(), a = null, c = !0;
|
|
134
|
+
t._layoutCompletion = E(k._source.bodyLayoutInput, i, f, {
|
|
135
|
+
scheduler: {
|
|
136
|
+
...h,
|
|
137
|
+
signal: n.signal
|
|
138
|
+
},
|
|
139
|
+
onPreview: (n) => {
|
|
140
|
+
if (!c) return;
|
|
141
|
+
let i = a === null, o = t._replaceMainLayoutPublication(e, f, a, n.layout);
|
|
142
|
+
if (o === null) {
|
|
143
|
+
c = !1;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (a = o, i) t._layoutLifecycle.begin(), w(t, {
|
|
147
|
+
pageCount: n.layout.pages.length,
|
|
148
|
+
exact: n.exact,
|
|
149
|
+
complete: !1
|
|
150
|
+
}), r.resolve();
|
|
151
|
+
else {
|
|
152
|
+
if (!t._isLayoutViewActive(f)) return;
|
|
153
|
+
w(t, {
|
|
154
|
+
pageCount: n.layout.pages.length,
|
|
155
|
+
exact: n.exact,
|
|
156
|
+
complete: !1
|
|
157
|
+
}), t._layoutObservers.notify("onLayoutPartial", M.onLayoutPartial, {
|
|
158
|
+
availableUnits: n.layout.pages.length,
|
|
159
|
+
exact: n.exact
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}).then((n) => {
|
|
164
|
+
c && t._replaceMainLayoutPublication(e, f, a, n) === null && (c = !1), t._layoutLifecycle.succeed(), w(t, {
|
|
165
|
+
pageCount: t.pageCount,
|
|
166
|
+
exact: !0,
|
|
167
|
+
complete: !0
|
|
168
|
+
}), t._layoutObservers.notify("onLayoutComplete", M.onLayoutComplete), r.resolve();
|
|
169
|
+
}).catch((e) => {
|
|
170
|
+
if (a === null) {
|
|
171
|
+
r.reject(e);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (e instanceof y) {
|
|
175
|
+
t._layoutLifecycle.succeed();
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
let n = t._layoutLifecycle.fail(e);
|
|
179
|
+
w(t, {
|
|
180
|
+
pageCount: t.pageCount,
|
|
181
|
+
exact: !1,
|
|
182
|
+
complete: !1,
|
|
183
|
+
error: n
|
|
184
|
+
}), t._layoutObservers.notify("onLayoutComplete", M.onLayoutComplete, n);
|
|
185
|
+
}), await r.promise;
|
|
186
|
+
} else if (l && (M.sliceLayout !== !1 || M.onLayoutProgress)) for (;;) {
|
|
187
|
+
L();
|
|
188
|
+
let e = N?.requestedView(), n = e === void 0 ? f : p(M.currentDate, t.defaultCurrentDateMs, e);
|
|
189
|
+
t.activeLayoutOptions = n;
|
|
190
|
+
let r = new AbortController(), a = !1, s = N?.subscribeViewChange(() => {
|
|
191
|
+
let e = N.requestedView();
|
|
192
|
+
a || e === void 0 || e === !0 == (n.showTrackedChanges === !0) || (a = !0, r.abort());
|
|
193
|
+
});
|
|
194
|
+
k._layoutAbort = r;
|
|
195
|
+
try {
|
|
196
|
+
let e = await v(k._source.bodyLayoutInput, i, n, {
|
|
197
|
+
...h,
|
|
198
|
+
signal: r.signal
|
|
199
|
+
});
|
|
200
|
+
if (L(), a) continue;
|
|
201
|
+
o.layoutVariants.prime(n, e);
|
|
202
|
+
break;
|
|
203
|
+
} catch (e) {
|
|
204
|
+
if (e instanceof y && a && !F?.aborted) continue;
|
|
205
|
+
throw e;
|
|
206
|
+
} finally {
|
|
207
|
+
s?.(), k._layoutAbort = null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else o.layoutVariants.layoutFor(f);
|
|
211
|
+
}
|
|
212
|
+
return L(), await k._resourceUsage(M.workerTimeoutMs ?? 1e3).then((e) => H.observeUsage(e), () => void 0), H.checkpoint("model and layout ready"), L(), H.succeed({ pages: k.pageCount }), i.release(), A;
|
|
213
|
+
} catch (e) {
|
|
214
|
+
throw D(t, k ? U : void 0), e;
|
|
215
|
+
} finally {
|
|
216
|
+
F?.removeEventListener("abort", U);
|
|
217
|
+
}
|
|
218
|
+
} finally {
|
|
219
|
+
i.release();
|
|
220
|
+
}
|
|
221
|
+
} catch (e) {
|
|
222
|
+
throw H.fail(e), e;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function I(e, t, n, r) {
|
|
226
|
+
let i = /* @__PURE__ */ new Map();
|
|
227
|
+
return j(e, {
|
|
228
|
+
discriminator: "type",
|
|
229
|
+
load: t,
|
|
230
|
+
parseMessage: (e) => ({
|
|
231
|
+
...e,
|
|
232
|
+
...N(t),
|
|
233
|
+
...n.showTrackedChanges === void 0 ? {} : { showTrackedChanges: n.showTrackedChanges }
|
|
234
|
+
}),
|
|
235
|
+
member: (e, t) => {
|
|
236
|
+
if (t === "addEventListener") return (t, a, o) => {
|
|
237
|
+
if (t !== "message") return e.addEventListener(t, a, o);
|
|
238
|
+
let s = (e) => {
|
|
239
|
+
let t = e.data;
|
|
240
|
+
n.showTrackedChanges === void 0 && (t.type === "documentSessionOpened" || t.type === "mainThreadVerticalFallback") && r(t.viewDefaults?.showTrackedChanges), (t.type === "parsedMeta" || t.type === "layoutPartial") && r(t.showTrackedChanges), typeof a == "function" ? a(e) : a.handleEvent(e);
|
|
241
|
+
};
|
|
242
|
+
i.set(a, s), e.addEventListener("message", s, o);
|
|
243
|
+
};
|
|
244
|
+
if (t === "removeEventListener") return (t, n, r) => e.removeEventListener(t, t === "message" ? i.get(n) ?? n : n, r);
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
249
|
+
export { F as loadDocxModelSource };
|