@epam/ai-dial-attachment-canvas 1.2.0-dev.3 → 1.2.0-dev.38

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.
Files changed (55) hide show
  1. package/{LazyContentBoundary-CRXN6PG3.js → LazyContentBoundary-tNE1ExbI.js} +2 -1
  2. package/{PdfContent-D71LPAe3.js → PdfContent-BoAtghsO.js} +1 -1
  3. package/PdfContent.css +1 -1
  4. package/{attachment-canvas-nvhW3tKV.js → attachment-canvas-BgwyzrRC.js} +2 -2
  5. package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
  6. package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
  7. package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
  8. package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts +36 -0
  9. package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts.map +1 -0
  10. package/components/PdfContent/PdfContent.d.ts.map +1 -1
  11. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +5 -3
  12. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -1
  13. package/context/AttachmentCanvasContext.d.ts.map +1 -1
  14. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +14 -1
  15. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -1
  16. package/index.css +2 -1
  17. package/index.d.ts +6 -3
  18. package/index.d.ts.map +1 -1
  19. package/index.js +567 -496
  20. package/models/attachment-canvas.d.ts +41 -10
  21. package/models/attachment-canvas.d.ts.map +1 -1
  22. package/{ooxml-highlight-surfaces-CaMjx8u-.js → ooxml-highlight-surfaces-BzgOKpBV.js} +182 -74
  23. package/package.json +3 -3
  24. package/types/attachment-canvas.d.ts +6 -1
  25. package/types/attachment-canvas.d.ts.map +1 -1
  26. package/utils/content.d.ts +16 -2
  27. package/utils/content.d.ts.map +1 -1
  28. package/utils/download.d.ts.map +1 -1
  29. package/utils/ooxml-highlight-surfaces.d.ts.map +1 -1
  30. package/utils/ooxml-table-row-highlight.d.ts +8 -0
  31. package/utils/ooxml-table-row-highlight.d.ts.map +1 -0
  32. package/utils/visualizer.d.ts +29 -1
  33. package/utils/visualizer.d.ts.map +1 -1
  34. package/utils/vite-external-matcher.d.ts +5 -5
  35. package/utils/vite-external-matcher.d.ts.map +1 -1
  36. package/bounded-raw-part-cache-Cg1BsSZQ-DN8p45IK.js +0 -37900
  37. package/chart-ex-DsESBs97.js +0 -1009
  38. package/comment-occurrence-C8Y2uoVr-C1cxz2TU.js +0 -6
  39. package/comment-ui-runtime-BfE7MJZn-DhQ_eg15.js +0 -112
  40. package/comment-ui-runtime-BsK8pmUT-EgWiymew.js +0 -2
  41. package/comment-ui-runtime-DcJOYlw--B15auUq-.js +0 -170
  42. package/comments-Diid5ujN-BdQhRNjI.js +0 -282
  43. package/delimited-text-worker-host-BVY-Ecni-AimUmSn0.js +0 -25
  44. package/docx-B-VcIRoc.js +0 -29870
  45. package/line-distribute-Dtudnqhs--BYZNgzX.js +0 -1237
  46. package/line-metrics-B60C86uh-DfQUk7X1.js +0 -60
  47. package/pptx-CnoDB8Fv.js +0 -9211
  48. package/read-only-comment-decoration-Dz7eTQ4d-Cl3RKKH6.js +0 -94
  49. package/read-only-comment-margin-DkgzASAl-BbDxMI5E.js +0 -189
  50. package/render-worker-host-BfbnEChF-D2thMRGX.js +0 -7
  51. package/render-worker-host-DNL9dWRh-Bky38ZHE.js +0 -7
  52. package/render-worker-host-IkHrYOci-DbjyHK7U.js +0 -7
  53. package/renderer-module-contract-D91rkYHH-BtfSKxb4.js +0 -10063
  54. package/visible-index-BgiHEc1z-BOzE9X5U.js +0 -162
  55. package/xlsx-Dn0XSlTO.js +0 -8610
@@ -1,6 +0,0 @@
1
- //#region ../../node_modules/@silurus/ooxml/dist/comment-occurrence-C8Y2uoVr.js
2
- function e(e, t, n) {
3
- return `slide:${n}:${e.id ?? `classic:${e.authorId ?? "unknown"}:${e.index ?? t}`}`;
4
- }
5
- //#endregion
6
- export { e as t };
@@ -1,112 +0,0 @@
1
- import "./renderer-module-contract-D91rkYHH-BtfSKxb4.js";
2
- import { O as e } from "./line-distribute-Dtudnqhs--BYZNgzX.js";
3
- import { t } from "./comment-occurrence-C8Y2uoVr-C1cxz2TU.js";
4
- import { a as n, i as r, n as i, s as a, t as o } from "./read-only-comment-margin-DkgzASAl-BbDxMI5E.js";
5
- import { i as s, n as c, r as l, t as u } from "./read-only-comment-decoration-Dz7eTQ4d-Cl3RKKH6.js";
6
- //#region ../../node_modules/@silurus/ooxml/dist/comment-ui-runtime-BfE7MJZn.js
7
- function d(e, t, n) {
8
- return {
9
- messageKey: `${t}:reply:${e.id ?? n}`,
10
- sourceId: e.id,
11
- author: e.author,
12
- date: e.date,
13
- text: e.text,
14
- status: e.status
15
- };
16
- }
17
- function f(a, o, c, l, u, f, p, m, h, g, _, v, y = !1, b, x) {
18
- n(a.ownerDocument), o && (o.dataset.ooxmlCommentZoom = String(g)), a.replaceChildren();
19
- let S = c.map((e, n) => ({
20
- comment: e,
21
- index: n,
22
- id: t(e, n, u)
23
- })).filter(({ comment: e }) => y || e.status !== "resolved" && e.status !== "closed"), C = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), T = new Map(l.map((e) => [e.elementId, e])), E = a.parentElement;
24
- for (let [t, n] of S.entries()) {
25
- let { comment: i, id: o } = n, s = (i.anchors ?? []).flatMap((e) => {
26
- if (e.type !== "drawingElement" && e.type !== "textRange" || !e.elementId) return [];
27
- let t = T.get(e.elementId);
28
- return t ? [t] : [];
29
- });
30
- if (m === o) for (let t of s) {
31
- let n = a.ownerDocument.createElement("div");
32
- n.dataset.ooxmlCommentTarget = o, n.style.cssText = `left:${e(t.bounds.x, f)};top:${e(t.bounds.y, p)};width:${e(t.bounds.width, f)};height:${e(t.bounds.height, p)};border-width:${2 * g}px;transform:rotate(${t.bounds.rotation}deg);`, a.appendChild(n);
33
- }
34
- let c = s[0]?.bounds, l = Number.isFinite(i.x) && Number.isFinite(i.y);
35
- if (!l && !c) continue;
36
- let u = Math.max(0, Math.min(c ? c.x + (l ? i.x : c.width) : i.x, f)), d = Math.max(0, Math.min(c ? c.y + (l ? i.y : 0) : i.y, p));
37
- if (C.set(o, Object.freeze({
38
- x: u / 9525 * g - 24 * g / 2,
39
- y: d / 9525 * g - 24 * g / 2,
40
- width: 24 * g,
41
- height: 24 * g
42
- })), m === o && s.length === 0 && !v) {
43
- let t = a.ownerDocument.createElement("div");
44
- t.dataset.ooxmlCommentTarget = o, t.style.cssText = `left:${e(u, f)};top:${e(d, p)};width:${24 * g}px;height:${24 * g}px;border-width:${2 * g}px;border-radius:50%;transform:translate(-50%,-50%);`, a.appendChild(t);
45
- }
46
- if (v) {
47
- let n = r(a.ownerDocument, {
48
- occurrenceKey: o,
49
- visibleIndex: t,
50
- author: i.author,
51
- active: m === o,
52
- zoom: g,
53
- onSetActive: h
54
- });
55
- n.style.left = e(u, f), n.style.top = e(d, p), a.appendChild(n), w.set(o, n);
56
- }
57
- }
58
- let D = S.map(({ comment: e, id: t }) => ({
59
- occurrenceKey: t,
60
- root: {
61
- messageKey: `${t}:root`,
62
- sourceId: e.id,
63
- author: e.author,
64
- date: e.date,
65
- text: e.text,
66
- status: e.status
67
- },
68
- replies: e.replies?.map((e, n) => d(e, t, n)) ?? []
69
- })), O = o ? i(o, D, {
70
- activeId: m,
71
- zoom: g,
72
- logicalWidth: _,
73
- onSetActive: h,
74
- onGeometryChange: b,
75
- onScrollGeometryChange: x,
76
- preferredTopById: new Map(D.map((e) => {
77
- let t = C.get(e.occurrenceKey);
78
- return [e.occurrenceKey, t?.y ?? 0];
79
- }))
80
- }) : /* @__PURE__ */ new Map();
81
- for (let e of S) {
82
- let t = O.get(e.id), n = w.get(e.id);
83
- t?.id && n && n.setAttribute("aria-controls", t.id);
84
- }
85
- if (!b && !x) return Object.freeze({
86
- threads: Object.freeze(D.map((e) => {
87
- let t = C.get(e.occurrenceKey);
88
- return Object.freeze({
89
- occurrenceKey: e.occurrenceKey,
90
- active: m === e.occurrenceKey,
91
- anchorRects: Object.freeze(t ? [t] : [])
92
- });
93
- })),
94
- scrollTop: o?.scrollTop ?? 0
95
- });
96
- let k = o && E ? s(o, E) : void 0, A = Object.freeze(D.map((e) => {
97
- let t = O.get(e.occurrenceKey), n = t && E ? s(t, E) : void 0, r = C.get(e.occurrenceKey);
98
- return Object.freeze({
99
- occurrenceKey: e.occurrenceKey,
100
- active: m === e.occurrenceKey,
101
- anchorRects: Object.freeze(r ? [r] : []),
102
- ...n ? { cardRect: n } : {}
103
- });
104
- }));
105
- return Object.freeze({
106
- threads: A,
107
- ...k ? { cardClipBounds: k } : {},
108
- scrollTop: o?.scrollTop ?? 0
109
- });
110
- }
111
- //#endregion
112
- export { f as buildPptxCommentMargin, c as buildReadOnlyCommentDecoration, u as disposeReadOnlyCommentDecoration, a as disposeReadOnlyCommentMargin, o as previewReadOnlyCommentMargin, l as projectReadOnlyCommentMarginScroll };
@@ -1,2 +0,0 @@
1
- import { r as e } from "./read-only-comment-margin-DkgzASAl-BbDxMI5E.js";
2
- export { e as paintReadOnlyCommentCard };
@@ -1,170 +0,0 @@
1
- import { O as e } from "./line-distribute-Dtudnqhs--BYZNgzX.js";
2
- import { a as t, i as n, n as r, o as i, s as a, t as o } from "./read-only-comment-margin-DkgzASAl-BbDxMI5E.js";
3
- import { i as s, n as c, r as l, t as u } from "./read-only-comment-decoration-Dz7eTQ4d-Cl3RKKH6.js";
4
- import { r as d, s as f } from "./comments-Diid5ujN-BdQhRNjI.js";
5
- //#region ../../node_modules/@silurus/ooxml/dist/comment-ui-runtime-DcJOYlw-.js
6
- function p(e, t) {
7
- let n = /* @__PURE__ */ new Set();
8
- for (let e of t) e.source && n.add(f(e.source));
9
- if (n.size === 0) return [];
10
- let r = [];
11
- for (let i of e) {
12
- if (!(n.has(f(i.source)) || n.has(f(i.reference.source)) || i.geometryFallback !== void 0 && n.has(f(i.geometryFallback.source)))) continue;
13
- let e = d(i, t);
14
- e.length > 0 && r.push({
15
- anchor: i,
16
- runs: e
17
- });
18
- }
19
- return r;
20
- }
21
- function m(e, t) {
22
- let n = new Map(e.map((e) => [e.id, e])), r = e.filter((e) => e.parentId === void 0), i = /* @__PURE__ */ new Map();
23
- for (let t of e) {
24
- if (t.parentId === void 0) continue;
25
- let e = t, r = new Set([e.id]);
26
- for (; e.parentId !== void 0;) {
27
- let i = n.get(e.parentId);
28
- if (!i || r.has(i.id)) {
29
- e = t;
30
- break;
31
- }
32
- r.add(i.id), e = i;
33
- }
34
- if (e.parentId !== void 0 || e === t) continue;
35
- let a = i.get(e.id) ?? [];
36
- i.has(e.id) || i.set(e.id, a), a.push(t);
37
- }
38
- return r.filter((e) => t || e.resolved !== !0).map((e) => ({
39
- root: e,
40
- replies: Object.freeze(i.get(e.id) ?? [])
41
- }));
42
- }
43
- function h(e, t, n) {
44
- return {
45
- messageKey: n === 0 ? `${t}:root` : `${t}:reply:${e.id || n - 1}`,
46
- sourceId: e.id,
47
- author: e.author,
48
- date: e.date,
49
- text: e.paragraphs?.join("\n") ?? e.text,
50
- status: e.resolved ? "resolved" : "active"
51
- };
52
- }
53
- function g(t, n, r, i, a, o) {
54
- let s = t.ownerDocument.createElement("div");
55
- return s.style.cssText = `--ooxml-comment-author-accent:${o};left:${e(n.x, r)};top:${e(n.y, i)};width:${e(n.w, r)};height:${e(n.h, i)};`, s.dataset.ooxmlCommentHighlight = "", s.dataset.active = String(a), n.transform && (s.style.transform = n.transform), t.appendChild(s), s;
56
- }
57
- function _(e) {
58
- let t = e.highlightBounds;
59
- return {
60
- ...e,
61
- x: t?.x ?? e.x,
62
- y: t?.y ?? e.y,
63
- w: t?.width ?? e.w,
64
- h: t?.height ?? e.h
65
- };
66
- }
67
- function v(e) {
68
- let t = [];
69
- for (let n of e) {
70
- let e = t.at(-1);
71
- if (e && e.y === n.y && e.h === n.h && e.transform === n.transform) {
72
- let r = Math.min(e.x, n.x), i = Math.max(e.x + e.w, n.x + n.w);
73
- t[t.length - 1] = {
74
- ...e,
75
- x: r,
76
- w: i - r
77
- };
78
- continue;
79
- }
80
- t.push({ ...n });
81
- }
82
- return t;
83
- }
84
- function y(e, a, o, c, l, u, d, f, y, b, x, S = !1, C, w) {
85
- t(e.ownerDocument), a && (a.dataset.ooxmlCommentZoom = String(y)), e.innerHTML = "";
86
- let T = m(c.comments, S), E = new Map(T.map((e) => [e.root.id, i(e.root.author)])), D = new Set(T.map((e) => e.root.id)), O = /* @__PURE__ */ new Map();
87
- for (let e of c.anchors) D.has(e.commentId) && !O.has(e.commentId) && O.set(e.commentId, e);
88
- let k = p(c.anchors, o), A = new Set(k.map(({ anchor: e }) => e)), j = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), N = e.parentElement;
89
- for (let { anchor: t, runs: n } of k) {
90
- if (!D.has(t.commentId)) continue;
91
- let r = d === t.commentId;
92
- for (let a of v(n.map(_))) {
93
- let n = g(e, a, l, u, r, E.get(t.commentId) ?? i(void 0)), o = a.transform && N ? s(n, N) : Object.freeze({
94
- x: a.x,
95
- y: a.y,
96
- width: a.w,
97
- height: a.h
98
- }), c = j.get(t.commentId) ?? [];
99
- j.has(t.commentId) || j.set(t.commentId, c);
100
- let d = o ?? Object.freeze({
101
- x: a.x,
102
- y: a.y,
103
- width: a.w,
104
- height: a.h
105
- });
106
- c.push(d), M.has(t.commentId) || M.set(t.commentId, Object.freeze({
107
- rect: d,
108
- ...a.direction ? { direction: a.direction } : {}
109
- }));
110
- }
111
- }
112
- let P = T.flatMap((e) => {
113
- let t = O.get(e.root.id);
114
- return !t || !A.has(t) ? [] : [{
115
- occurrenceKey: e.root.id,
116
- root: h(e.root, e.root.id, 0),
117
- replies: e.replies.map((t, n) => h(t, e.root.id, n + 1))
118
- }];
119
- }), F = a ? r(a, P, {
120
- activeId: d,
121
- zoom: y,
122
- logicalWidth: b,
123
- onSetActive: f,
124
- onGeometryChange: C,
125
- onScrollGeometryChange: w,
126
- preferredTopById: new Map(P.map((e) => {
127
- let t = j.get(e.occurrenceKey)?.[0];
128
- return [e.occurrenceKey, t?.y ?? 0];
129
- }))
130
- }) : /* @__PURE__ */ new Map();
131
- if (x) for (let [t, r] of P.entries()) {
132
- let i = M.get(r.occurrenceKey);
133
- if (!i) continue;
134
- let a = n(e.ownerDocument, {
135
- occurrenceKey: r.occurrenceKey,
136
- visibleIndex: t,
137
- author: r.root.author,
138
- active: d === r.occurrenceKey,
139
- zoom: y,
140
- onSetActive: f
141
- }), o = 24 * y / 2, s = 4 * y, c = e.ownerDocument.defaultView?.getComputedStyle?.(e).direction, p = (i.direction ?? c) === "rtl" ? i.rect.x - s - o : i.rect.x + i.rect.width + s + o, m = Math.max(o, Math.min(p, l - o)), h = Math.max(o, Math.min(i.rect.y + i.rect.height / 2, u - o));
142
- a.style.left = `${m / l * 100}%`, a.style.top = `${h / u * 100}%`;
143
- let g = F.get(r.occurrenceKey);
144
- g?.id && a.setAttribute("aria-controls", g.id), e.appendChild(a);
145
- }
146
- if (!C && !w) return Object.freeze({
147
- threads: Object.freeze(P.map((e) => Object.freeze({
148
- occurrenceKey: e.occurrenceKey,
149
- active: d === e.occurrenceKey,
150
- anchorRects: Object.freeze(j.get(e.occurrenceKey) ?? [])
151
- }))),
152
- scrollTop: a?.scrollTop ?? 0
153
- });
154
- let I = a && N ? s(a, N) : void 0, L = Object.freeze(P.map((e) => {
155
- let t = F.get(e.occurrenceKey), n = t && N ? s(t, N) : void 0;
156
- return Object.freeze({
157
- occurrenceKey: e.occurrenceKey,
158
- active: d === e.occurrenceKey,
159
- anchorRects: Object.freeze(j.get(e.occurrenceKey) ?? []),
160
- ...n ? { cardRect: n } : {}
161
- });
162
- }));
163
- return Object.freeze({
164
- threads: L,
165
- ...I ? { cardClipBounds: I } : {},
166
- scrollTop: a?.scrollTop ?? 0
167
- });
168
- }
169
- //#endregion
170
- export { y as buildDocxCommentMargin, c as buildReadOnlyCommentDecoration, u as disposeReadOnlyCommentDecoration, a as disposeReadOnlyCommentMargin, o as previewReadOnlyCommentMargin, l as projectReadOnlyCommentMarginScroll };
@@ -1,282 +0,0 @@
1
- //#region ../../node_modules/@silurus/ooxml/dist/source-key-DIJG8BA0.js
2
- function e(t, n = "$") {
3
- if (t === null || typeof t == "boolean" || typeof t == "number" || typeof t == "string") return JSON.stringify(t);
4
- if (Array.isArray(t)) return `[${t.map((t, r) => e(t, `${n}[${r}]`)).join(",")}]`;
5
- if (typeof t == "object") {
6
- let r = t;
7
- return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${e(r[t], `${n}.${t}`)}`).join(",")}}`;
8
- }
9
- throw TypeError(`Cannot fingerprint ${typeof t} at ${n}`);
10
- }
11
- function t(t, n) {
12
- let r = e(n);
13
- return `${t}:${encodeURIComponent(r)}`;
14
- }
15
- function n(e) {
16
- return `${e.story}:${encodeURIComponent(e.storyInstance)}:${e.path.join(".")}`;
17
- }
18
- function r(e, t, r) {
19
- if (t.length === 0 || r.length === 0) throw RangeError("Body occurrence identity requires a flow domain and fragment start");
20
- return [
21
- "body-occurrence",
22
- encodeURIComponent(n(e)),
23
- encodeURIComponent(t),
24
- encodeURIComponent(r)
25
- ].join("/");
26
- }
27
- function i(e, t) {
28
- return `image:${n(e)}:${encodeURIComponent(t)}`;
29
- }
30
- function a(e, t) {
31
- return `math:${n(e)}:${encodeURIComponent(t)}`;
32
- }
33
- function o(e) {
34
- return t("chart-resource", e);
35
- }
36
- function s(e, t) {
37
- return `anchor:${n(e)}:${encodeURIComponent(t)}`;
38
- }
39
- //#endregion
40
- //#region ../../node_modules/@silurus/ooxml/dist/comments-Diid5ujN.js
41
- function c(e) {
42
- if (e === void 0) return;
43
- let t = e.replace(/^[\t\n\r ]+|[\t\n\r ]+$/g, "");
44
- if (/^[+-]?\d+$/.test(t)) try {
45
- return BigInt(t).toString();
46
- } catch {
47
- return;
48
- }
49
- }
50
- function l(e) {
51
- return Object.freeze({
52
- ...e,
53
- path: Object.freeze([...e.path])
54
- });
55
- }
56
- function u(e) {
57
- return Object.freeze({
58
- source: l(e.source),
59
- runIndex: e.boundary,
60
- affinity: e.boundary < e.runCount ? "following" : "preceding"
61
- });
62
- }
63
- function d(e, t) {
64
- let n = e.runs, r = 0;
65
- for (let e = 0; e < Math.min(t, n.length); e += 1) n[e]?.type !== "unavailableDrawing" && (r += 1);
66
- return r;
67
- }
68
- function f(e, t, n, r, i = t.boundary) {
69
- return Object.freeze({
70
- commentId: e,
71
- source: l(t.source),
72
- startRunIndex: t.boundary,
73
- endRunIndex: i,
74
- reference: u(n),
75
- ...r === void 0 ? {} : { geometryFallback: Object.freeze({
76
- source: l(r.source),
77
- sourceRunIndex: r.boundary
78
- }) }
79
- });
80
- }
81
- function p(e, t) {
82
- let r = e.flatMap(({ paragraph: e, source: r }, i) => {
83
- let a = d(e, e.runs.length);
84
- return [...t.get(n(r)) ?? []].sort((e, t) => e - t).map((e) => ({
85
- paragraphIndex: i,
86
- source: r,
87
- boundary: e,
88
- runCount: a
89
- }));
90
- });
91
- return {
92
- locations: r,
93
- paragraphIndices: new Set(r.map(({ paragraphIndex: e }) => e))
94
- };
95
- }
96
- function m(e, t) {
97
- return e.paragraphIndex - t.paragraphIndex || e.boundary - t.boundary;
98
- }
99
- function h(e, t) {
100
- let n = 0, r = e.length;
101
- for (; n < r;) {
102
- let i = n + Math.floor((r - n) / 2);
103
- m(e[i], t) < 0 ? n = i + 1 : r = i;
104
- }
105
- return n;
106
- }
107
- function g(e, t) {
108
- if (t.paragraphIndices.has(e.paragraphIndex)) return;
109
- let n = h(t.locations, e), r = t.locations[n], i = n > 0 ? t.locations[n - 1] : void 0;
110
- return u(e).affinity === "following" ? r ?? i : i ?? r;
111
- }
112
- function _(e, t, n) {
113
- let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
114
- for (let e of t) {
115
- let t = c(e);
116
- t === void 0 || i.has(t) || (r.has(t) ? (r.delete(t), i.add(t)) : r.set(t, e));
117
- }
118
- let a = /* @__PURE__ */ new Map();
119
- for (let [t, { paragraph: n, source: r }] of e.entries()) for (let e of n.commentMarks ?? []) {
120
- let i = c(e.id);
121
- if (i === void 0) continue;
122
- let o = a.get(i) ?? {
123
- starts: [],
124
- ends: [],
125
- references: []
126
- };
127
- a.set(i, o);
128
- let s = {
129
- paragraphIndex: t,
130
- source: r,
131
- boundary: d(n, e.runIndex),
132
- runCount: d(n, n.runs.length)
133
- };
134
- e.kind === "rangeStart" ? o.starts.push(s) : e.kind === "rangeEnd" ? o.ends.push(s) : e.kind === "reference" && o.references.push(s);
135
- }
136
- let o = [], s = p(e, n);
137
- for (let [t, n] of a) {
138
- let i = r.get(t);
139
- if (i === void 0 || n.references.length !== 1) continue;
140
- let a = n.references[0];
141
- if (n.starts.length > 1 || n.ends.length > 1) continue;
142
- let c = n.starts.length === 1 ? n.starts[0] : void 0, l = n.ends.length === 1 ? n.ends[0] : void 0;
143
- if (c && l && (c.paragraphIndex < l.paragraphIndex || c.paragraphIndex === l.paragraphIndex && c.boundary <= l.boundary)) {
144
- let t = g(c.paragraphIndex === l.paragraphIndex && c.boundary === l.boundary ? c : a, s);
145
- for (let n = c.paragraphIndex; n <= l.paragraphIndex; n += 1) {
146
- let r = e[n], s = n === c.paragraphIndex ? c.boundary : 0, u = n === l.paragraphIndex ? l.boundary : d(r.paragraph, r.paragraph.runs.length);
147
- o.push(f(i, {
148
- paragraphIndex: n,
149
- source: r.source,
150
- boundary: s,
151
- runCount: d(r.paragraph, r.paragraph.runs.length)
152
- }, a, t, Math.max(s, u)));
153
- }
154
- continue;
155
- }
156
- let u = c && n.ends.length === 0 ? c : l && n.starts.length === 0 ? l : void 0;
157
- if (c && l) continue;
158
- let p = u ?? a, m = g(p, s);
159
- o.push(f(i, p, a, m));
160
- }
161
- return o;
162
- }
163
- function v(e, t, n = /* @__PURE__ */ new Map()) {
164
- let r = new Set(e.map(({ id: e }) => e)), i = /* @__PURE__ */ new Map();
165
- for (let e of t.blocks.sources) {
166
- let n = t.blocks.resolve(e);
167
- if (n.type !== "paragraph") continue;
168
- let r = `${e.story}\u0000${e.storyInstance}`, a = i.get(r) ?? [];
169
- i.has(r) || i.set(r, a), a.push({
170
- paragraph: n,
171
- source: e
172
- });
173
- }
174
- return [...i.values()].flatMap((e) => _(e, r, n));
175
- }
176
- function y(e, t, r = /* @__PURE__ */ new Map(), i = {}) {
177
- if ((e?.length ?? 0) === 0) return [];
178
- let a = v(e ?? [], t, r), o = i.completedSourceKeys;
179
- return o === void 0 ? a : a.filter((e) => {
180
- let t = r.get(n(e.source)) ?? /* @__PURE__ */ new Set(), i = e.startRunIndex < e.endRunIndex ? [...t].some((t) => t >= e.startRunIndex && t < e.endRunIndex) : t.has(e.reference.affinity === "following" ? e.startRunIndex : e.startRunIndex - 1), a = r.get(n(e.reference.source))?.has(e.reference.affinity === "following" ? e.reference.runIndex : e.reference.runIndex - 1) === !0;
181
- return i || a || o.has(n(e.source)) || o.has(n(e.reference.source));
182
- });
183
- }
184
- function b(e, t) {
185
- return e !== void 0 && e.story === t.story && e.storyInstance === t.storyInstance && e.path.length === t.path.length && e.path.every((e, n) => e === t.path[n]);
186
- }
187
- function x(e, t) {
188
- let n = t.filter((t) => t.sourceRunIndex !== void 0 && b(t.source, e.source)), r = n.filter((t) => t.sourceRunIndex >= e.startRunIndex && t.sourceRunIndex < e.endRunIndex);
189
- if (r.length > 0) return r;
190
- if (e.startRunIndex === e.endRunIndex && n.length > 0) {
191
- let t = n.reduce((t, n) => {
192
- let r = n.sourceRunIndex;
193
- return r < e.startRunIndex ? t : t === void 0 || r < t ? r : t;
194
- }, void 0), r = n.reduce((t, n) => {
195
- let r = n.sourceRunIndex;
196
- return r >= e.startRunIndex ? t : t === void 0 || r > t ? r : t;
197
- }, void 0), i = t ?? r;
198
- if (i !== void 0) return n.filter((e) => e.sourceRunIndex === i);
199
- }
200
- let i = t.filter((t) => t.sourceRunIndex !== void 0 && b(t.source, e.reference.source)), a = i.reduce((t, n) => {
201
- let r = n.sourceRunIndex;
202
- return r < e.reference.runIndex ? t : t === void 0 || r < t ? r : t;
203
- }, void 0), o = i.reduce((t, n) => {
204
- let r = n.sourceRunIndex;
205
- return r >= e.reference.runIndex ? t : t === void 0 || r > t ? r : t;
206
- }, void 0), s = e.reference.affinity === "following" ? a ?? o : o ?? a;
207
- if (s !== void 0) return i.filter((e) => e.sourceRunIndex === s);
208
- let c = e.geometryFallback;
209
- return c === void 0 ? [] : t.filter((e) => e.sourceRunIndex === c.sourceRunIndex && b(e.source, c.source));
210
- }
211
- function S(e, t) {
212
- return t.some((t) => t.sourceRunIndex !== void 0 && b(t.source, e.source) && t.sourceRunIndex >= e.startRunIndex && t.sourceRunIndex < e.endRunIndex) ? "range" : t.some((t) => b(t.source, e.source) || b(t.source, e.reference.source)) ? "point" : "fallback";
213
- }
214
- function C(e) {
215
- let t = e.map((e) => {
216
- let t = e.highlightBounds;
217
- return {
218
- x: t?.x ?? e.x,
219
- y: t?.y ?? e.y,
220
- width: t?.width ?? e.w,
221
- height: t?.height ?? e.h,
222
- ...e.transform ? { transform: e.transform } : {}
223
- };
224
- }).filter(({ width: e, height: t }) => e > 0 && t > 0).sort((e, t) => e.y - t.y || e.x - t.x), n = [];
225
- for (let e of t) {
226
- let t = n.at(-1);
227
- if (t && t.y === e.y && t.height === e.height && t.transform === e.transform) {
228
- let r = Math.min(t.x, e.x), i = Math.max(t.x + t.width, e.x + e.width);
229
- n[n.length - 1] = Object.freeze({
230
- ...t,
231
- x: r,
232
- width: i - r
233
- });
234
- } else n.push(Object.freeze({ ...e }));
235
- }
236
- return Object.freeze(n);
237
- }
238
- function w(e, t, r, i = {}) {
239
- let a = new Map(e.map((e) => [e.id, e])), o = e.filter((e) => e.parentId === void 0), s = new Map(o.map((e) => [e.id, e])), c = /* @__PURE__ */ new Map(), l = new Map(o.map((e) => [e.id, e.id]));
240
- for (let t of e) {
241
- if (t.parentId === void 0) continue;
242
- let e = new Set([t.id]), n = t;
243
- for (; n.parentId !== void 0;) {
244
- let r = a.get(n.parentId);
245
- if (!r || e.has(r.id)) {
246
- n = t;
247
- break;
248
- }
249
- e.add(r.id), n = r;
250
- }
251
- if (!s.has(n.id) || n === t) continue;
252
- l.set(t.id, n.id);
253
- let r = c.get(n.id) ?? [];
254
- c.has(n.id) || c.set(n.id, r), r.push(t);
255
- }
256
- let u = /* @__PURE__ */ new Set();
257
- for (let e of r) e.source && u.add(n(e.source));
258
- let d = /* @__PURE__ */ new Map();
259
- for (let e of t) {
260
- let t = l.get(e.commentId);
261
- if (t === void 0 || !(u.has(n(e.source)) || u.has(n(e.reference.source)) || e.geometryFallback !== void 0 && u.has(n(e.geometryFallback.source)))) continue;
262
- let i = x(e, r);
263
- if (i.length === 0) continue;
264
- let a = d.get(t) ?? [];
265
- d.has(t) || d.set(t, a), a.push(Object.freeze({
266
- anchor: e,
267
- kind: S(e, i),
268
- rects: C(i)
269
- }));
270
- }
271
- return Object.freeze(o.flatMap((e) => {
272
- if (i.includeResolved === !1 && e.resolved === !0) return [];
273
- let t = d.get(e.id);
274
- return t?.length ? [Object.freeze({
275
- root: e,
276
- replies: Object.freeze([...c.get(e.id) ?? []]),
277
- anchors: Object.freeze([...t])
278
- })] : [];
279
- }));
280
- }
281
- //#endregion
282
- export { a, o as c, t as d, c as i, r as l, y as n, i as o, x as r, n as s, w as t, s as u };
@@ -1,25 +0,0 @@
1
- //#region ../../node_modules/@silurus/ooxml/dist/delimited-text-worker-host-BVY-Ecni.js
2
- var e = "var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=class e extends Error{code;constructor(t,n){super(n),this.name=`OoxmlError`,this.code=t,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 r(e){return e===`image-dimension`||e===`image-pixels`||e===`active-decoded-bytes`}function i(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function a(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,a=t.metric,o=t.limit,s=t.observed;return n!==`ooxml-decoded-image-limit`||!r(a)||!i(o)||!i(s)||s<=o?void 0:{metric:a,limit:o,observed:s}}catch{return}}var o,s,c,l=e((()=>{o=1<<25,s=1<<27,o*4,s*4,c=class e extends RangeError{code=`ooxml-decoded-image-limit`;constructor(t,n,r){super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`),this.metric=t,this.limit=n,this.observed=r,this.name=`OoxmlDecodedImageLimitError`,Object.setPrototypeOf(this,e.prototype)}}}));function u(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 d=e((()=>{}));function f(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function p(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 m=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 h(e){if(e instanceof m)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`||!p(r)))return new m(r)}l(),d();const g=`OOXML_RESOURCE_LIMIT:`;function _(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function v(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return _(t.archiveEntryCount)&&_(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||_(t.largestInflatedEntryBytes))&&_(t.distinctInflatedBytes)&&_(t.operationInflatedBytes)}function y(e){return e===`docx`||e===`xlsx`||e===`pptx`}function b(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function x(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function S(e){return x(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function C(e){return!x(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 w=new Map([[`archive-entry:declared-inflated-bytes`,{stage:`container`,part:`required`}],[`archive-entry:actual-inflated-bytes`,{stage:`decompression`,part:`required`}],[`archive:entry-count`,{stage:`container`,part:`forbidden`}],[`archive:central-directory-bytes`,{stage:`container`,part:`forbidden`,configurable:!1}],[`archive:distinct-inflated-bytes`,{stage:`decompression`,part:`required`}],[`xml-event:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-context:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-tree:depth`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-row:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-shell:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}]]),T=new Set([...w.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),E=new Set([...w.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function D(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!y(t.format)||!x(t.operation,256)||!S(t.resource)||!S(t.metric)||!_(t.limit)||!_(t.observed)||typeof t.configurable!=`boolean`||!v(t.usage)?!1:!(`part`in t)||C(t.part)}function O(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!b(t.stage)||!D(t.violation))return!1;let n=t.violation,r=w.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:!(T.has(n.resource)&&E.has(n.metric))}function k(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function A(e){if(!O(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:k(t.usage)}};return O(n)?n:void 0}function j(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``}: ${t.metric} ${t.observed} > ${t.limit}`}function M(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(g))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`||!O(i.details)))return new n(j(i.details),i.details)}function N(e){let r=a(e);if(r){let e=new c(r.metric,r.limit,r.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:r}}let i=u(e);if(i)return{message:i.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let o=h(e);if(o)return{message:o.message,errorName:o.name,code:o.code,insufficientCredit:{requiredBytes:o.requiredBytes,offeredBytes:o.offeredBytes}};let s=e instanceof t||e instanceof n?e:M(e);if(s instanceof n){let e=A(s.details);return e?{message:typeof s.message==`string`?s.message:j(e),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:e}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(s instanceof t)return{message:typeof s.message==`string`?s.message:String(s.message),errorName:x(s.name,128)?s.name:`OoxmlError`,...S(s.code)?{code:s.code}:{}};let l=e instanceof Error?e.message:String(e);if(typeof l==`string`&&l.startsWith(g))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let d=e instanceof Error?e:Error(l),f=d;return{message:typeof d.message==`string`?d.message:String(d.message),errorName:x(d.name,128)?d.name:`Error`,...typeof f.code==`string`?{code:f.code}:{}}}function P(e){try{return N(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}function F(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function I(e,t,n){return F(e,`resource measurement`),F(t,`resource measurement`),F(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function L(e,t=2**53-1){F(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=I(n,a,t),n>t)return n}return n}function R(e,t=2**53-1){F(t,`resource measurement limit`);let n=I(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=I(n,a,t),n>t)return n}return n}function z(e,t){return I(0,e,t)}function B(e,t=2**53-1,n=!1){if(F(t,`resource measurement limit`),e===null)return{jsonBytes:z(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:R(e,t),stringValueUtf8Bytes:L(e,t)};if(typeof e==`boolean`)return{jsonBytes:z(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:z((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=z(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=I(n,1,t));let a=B(e[i],t,!0);n=I(n,a.jsonBytes,t),r=I(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=z(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=I(n,1,t)),n=I(n,R(a,t),t),n=I(n,1,t);let e=B(o,t);n=I(n,e.jsonBytes,t),r=I(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?z(4,t):0,stringValueUtf8Bytes:0}}const V=1e5,H=25e4,U=33554432,W=67108864,G=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function K(e){let t=e.reduce((e,t)=>I(e,t.cells.length,H),0);return{rows:e.length,cells:t,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=B(t.value,U).stringValueUtf8Bytes;return I(e,I(n,t.formula===void 0?0:L(t.formula,U),U),U)},e),0)}}function q(e){return J(e,K(e.rows))}function J(e,t){let n=B(e,67108864);return{...t,jsonBytes:n.jsonBytes}}function Y(e,t,r,i,a,o,s){let c=r===`worksheet-json`?`serialization`:`parsing`;return new n(`OOXML resource limit exceeded${t?` for ${t}`:``}: ${i} ${o} > ${a}`,{stage:c,violation:{format:`xlsx`,operation:e,resource:r,metric:i,...t===void 0?{}:{part:t},limit:a,observed:Math.min(o,a+1),configurable:!1,usage:s??G}})}function X(e,t,n,r){let i=[[`rows`,e.rows,V],[`cells`,e.cells,H],[`owned-utf8-bytes`,e.ownedUtf8Bytes,U]];for(let[e,a,o]of i)if(a>o)throw Y(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,o,a,r)}function Z(e,t,n,r){if(e>W)throw Y(t,n,`worksheet-json`,`bytes`,W,e,r)}const Q=`load-delimited-text`,$=W;function ee(e){if(e>$)throw Y(Q,void 0,`delimited-text-source`,`bytes`,$,e)}const te=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 ne(e,t){ee(e.byteLength);let n;try{n=new TextDecoder(t.encoding,{fatal:!0}).decode(e)}catch(e){throw TypeError(`Delimited text could not be decoded as ${t.encoding}`,{cause:e})}let r=[],i=[],a=``,o,s=1,c=1,l=0,u=0,d=!1,f=!1,p=e=>{a+=e,a.length>=4096&&((o??=[]).push(a),a=``)},m=()=>{if(l++,l>H)throw Y(Q,void 0,`worksheet-model`,`cells`,H,l);if(c>16384)throw RangeError(`Delimited text row ${s} has more than 16384 columns`);let e=o?o.join(``)+a:a;if(e!==``){if(u+=L(e,U+1),u>U)throw Y(Q,void 0,`worksheet-cell-content`,`owned-utf8-bytes`,U,u);i.push({row:s,col:c,value:{type:`text`,text:e}})}a=``,o=void 0,c++,f=!1},h=()=>{if(s>V)throw Y(Q,void 0,`worksheet-model`,`rows`,V,s);r.push({index:s,height:null,cells:i}),i=[],s++,c=1};for(let e=0;e<n.length;e++){let r=n[e];if(d){if(r!==`\"`){r===`\\r`?(p(`\n`),n[e+1]===`\n`&&e++):p(r);continue}n[e+1]===`\"`?(p(`\"`),e++):(d=!1,f=!0);continue}if(f){if(r!==t.delimiter&&r!==`\\r`&&r!==`\n`)throw SyntaxError(`Unexpected character after closing quote at row ${s}, column ${c}`)}else if(r===`\"`&&a===``&&o===void 0){d=!0;continue}if(r===t.delimiter){m();continue}if(r===`\\r`||r===`\n`){m(),h(),r===`\\r`&&n[e+1]===`\n`&&e++;continue}p(r)}if(d)throw SyntaxError(`Unterminated quoted field at row ${s}, column ${c}`);let g=n.endsWith(`\n`)||n.endsWith(`\\r`);n.length>0&&!g&&(m(),h());let _={name:t.sheetName,rows:r,colWidths:{},rowHeights:{},defaultColWidth:8.43,defaultRowHeight:15,mergeCells:[],freezeRows:0,freezeCols:0,conditionalFormats:[],images:[],charts:[],defaultFontFamily:`Calibri`,defaultFontSize:11},v=q(_);return X(v,Q,void 0),Z(v.jsonBytes,Q,void 0),{workbook:{workbook:{sheets:[{name:t.sheetName,sheetId:1,rId:`rId1`}]},styles:te,sharedStrings:[]},worksheet:_}}self.onmessage=e=>{let t=e.data;try{let{workbook:e,worksheet:n}=ne(t.data,t.options),r=new TextEncoder().encode(JSON.stringify(n)).buffer,i={type:`delimitedTextParsed`,id:t.id,workbook:e,worksheetJson:r};self.postMessage(i,[r])}catch(e){let n={type:`error`,id:t.id,...P(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
- function r() {
22
- return new n();
23
- }
24
- //#endregion
25
- export { r as createDelimitedTextWorker };