f-docx-editor 0.1.3 → 0.1.5

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.
@@ -0,0 +1,688 @@
1
+ "use strict";
2
+ ((typeof self !== 'undefined' ? self : this)["webpackChunkf_docx_editor"] = (typeof self !== 'undefined' ? self : this)["webpackChunkf_docx_editor"] || []).push([[594],{
3
+
4
+ /***/ 2594:
5
+ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
6
+
7
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8
+ /* harmony export */ injectReplyRangeMarkers: function() { return /* binding */ Jt; },
9
+ /* harmony export */ injectTCReplyRangeMarkers: function() { return /* binding */ Zt; }
10
+ /* harmony export */ });
11
+ /* unused harmony exports DEFAULT_TAB_ALIGNMENT, DEFAULT_TAB_INTERVAL_TWIPS, DEFAULT_TAB_LEADER, KNOWN_FIELD_TYPES, calculateTabWidth, calculateTabWidthWithAlignment, createComplexFieldContext, getFieldDisplayValue, getFormatSwitch, getLeaderCharacter, getNextTabStop, getOutlineWidthPx, getShapeDimensionsPx, getShapeHeightPx, getShapeWidthPx, hasFill, hasMergeFormat, hasOutline, hasTextContent, hasVisibleLeader, isDateTimeField, isDocPropertyField, isFloatingShape, isKnownFieldType, isLineShape, isMergeField, isPageNumberField, isReferenceField, isShapeDrawing, isTextBoxShape, isTocField, isTotalPagesField, mergeTabStops, parseFieldInstruction, parseFieldType, parseShape, parseShapeFromDrawing, parseSimpleField, parseTabStop, parseTabStops, parseTabStopsFromParagraphProperties, resolveFillColor, resolveOutlineColor */
12
+ /* unused harmony import specifier */ var z;
13
+ /* unused harmony import specifier */ var b;
14
+ /* unused harmony import specifier */ var a;
15
+ /* unused harmony import specifier */ var c;
16
+ /* unused harmony import specifier */ var d;
17
+ /* unused harmony import specifier */ var e$1;
18
+ /* unused harmony import specifier */ var j;
19
+ /* unused harmony import specifier */ var f;
20
+ /* unused harmony import specifier */ var i;
21
+ /* unused harmony import specifier */ var h;
22
+ /* unused harmony import specifier */ var g;
23
+ /* unused harmony import specifier */ var l;
24
+ /* unused harmony import specifier */ var e$2;
25
+ /* unused harmony import specifier */ var e;
26
+ /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4423);
27
+ /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4114);
28
+ /* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8111);
29
+ /* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2489);
30
+ /* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(116);
31
+ /* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1701);
32
+ /* harmony import */ var core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3579);
33
+ /* harmony import */ var core_js_modules_es_map_get_or_insert_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5367);
34
+ /* harmony import */ var core_js_modules_es_map_get_or_insert_computed_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2731);
35
+ /* harmony import */ var core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7642);
36
+ /* harmony import */ var core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8004);
37
+ /* harmony import */ var core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(3853);
38
+ /* harmony import */ var core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5876);
39
+ /* harmony import */ var core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2475);
40
+ /* harmony import */ var core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(5024);
41
+ /* harmony import */ var core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(1698);
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ var M = (/* unused pure expression or super */ null && (["PAGE", "NUMPAGES", "NUMWORDS", "NUMCHARS", "DATE", "TIME", "CREATEDATE", "SAVEDATE", "PRINTDATE", "EDITTIME", "AUTHOR", "TITLE", "SUBJECT", "KEYWORDS", "COMMENTS", "FILENAME", "FILESIZE", "TEMPLATE", "REVNUM", "DOCPROPERTY", "DOCVARIABLE", "REF", "PAGEREF", "NOTEREF", "HYPERLINK", "TOC", "TOA", "INDEX", "SEQ", "STYLEREF", "AUTONUM", "AUTONUMLGL", "AUTONUMOUT", "SECTION", "SECTIONPAGES", "USERADDRESS", "USERNAME", "USERINITIALS", "IF", "MERGEFIELD", "NEXT", "NEXTIF", "ASK", "SET", "QUOTE", "INCLUDETEXT", "INCLUDEPICTURE", "SYMBOL", "ADVANCE"]));
75
+ function I(e) {
76
+ if (!e) return "UNKNOWN";
77
+ let n = e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);
78
+ if (!n) return "UNKNOWN";
79
+ let o = n[1].toUpperCase();
80
+ return M.includes(o) ? o : "UNKNOWN";
81
+ }
82
+ function at(e) {
83
+ return M.includes(e);
84
+ }
85
+ function st(e) {
86
+ let t = I(e),
87
+ n = e.trim(),
88
+ o = [],
89
+ r = n.match(/^\\?([A-Z][A-Z0-9]*)/i),
90
+ i = r ? r[0].length : 0,
91
+ a = n.substring(i).trim(),
92
+ s = /\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,
93
+ l,
94
+ u = [];
95
+ for (; (l = s.exec(a)) !== null;) {
96
+ let p = {
97
+ switch: l[1]
98
+ };
99
+ l[2] ? p.value = l[2] : l[3] && (p.value = l[3]), o.push(p), u.push({
100
+ start: l.index,
101
+ end: l.index + l[0].length
102
+ });
103
+ }
104
+ let c;
105
+ if (a.length > 0) {
106
+ let p = u.length > 0 ? u[0].start : a.length,
107
+ m = a.substring(0, p).trim();
108
+ m.startsWith('"') && m.endsWith('"') ? c = m.slice(1, -1) : m && (c = m);
109
+ }
110
+ return {
111
+ type: t,
112
+ raw: e,
113
+ argument: c,
114
+ switches: o
115
+ };
116
+ }
117
+ function pt(e) {
118
+ return e.switches.find(n => n.switch === "*" || n.switch === "@")?.value;
119
+ }
120
+ function ct(e) {
121
+ return e.switches.find(n => n.switch === "*")?.value?.toUpperCase() === "MERGEFORMAT";
122
+ }
123
+ function ut(e, t, n) {
124
+ let o = j(e, "w", "instr") ?? "",
125
+ r = I(o),
126
+ i = {
127
+ type: "simpleField",
128
+ instruction: o,
129
+ fieldType: r,
130
+ content: []
131
+ },
132
+ a = j(e, "w", "fldLock");
133
+ (a === "1" || a === "true") && (i.fldLock = true);
134
+ let s = j(e, "w", "dirty");
135
+ (s === "1" || s === "true") && (i.dirty = true);
136
+ let l = f(e, "w", "r");
137
+ for (let u of l) {
138
+ let c = z(u, t, n);
139
+ i.content.push(c);
140
+ }
141
+ return i;
142
+ }
143
+ function dt() {
144
+ return {
145
+ state: "outside",
146
+ instruction: "",
147
+ codeRuns: [],
148
+ resultRuns: [],
149
+ fldLock: false,
150
+ dirty: false,
151
+ nestingLevel: 0
152
+ };
153
+ }
154
+ function ft(e) {
155
+ return e.type === "simpleField" ? e.content.filter(t => "content" in t).map(t => U(t)).join("") : e.fieldResult.map(t => U(t)).join("");
156
+ }
157
+ function U(e) {
158
+ return e.content.filter(t => t.type === "text").map(t => t.text).join("");
159
+ }
160
+ function mt(e) {
161
+ return e.fieldType === "PAGE";
162
+ }
163
+ function ht(e) {
164
+ return e.fieldType === "NUMPAGES";
165
+ }
166
+ function gt(e) {
167
+ return ["DATE", "TIME", "CREATEDATE", "SAVEDATE", "PRINTDATE", "EDITTIME"].includes(e.fieldType);
168
+ }
169
+ function Tt(e) {
170
+ return ["AUTHOR", "TITLE", "SUBJECT", "KEYWORDS", "COMMENTS", "FILENAME", "FILESIZE", "TEMPLATE", "REVNUM", "DOCPROPERTY", "DOCVARIABLE"].includes(e.fieldType);
171
+ }
172
+ function xt(e) {
173
+ return ["REF", "PAGEREF", "NOTEREF"].includes(e.fieldType);
174
+ }
175
+ function yt(e) {
176
+ return ["MERGEFIELD", "IF", "NEXT", "NEXTIF", "ASK", "SET"].includes(e.fieldType);
177
+ }
178
+ function St(e) {
179
+ return ["TOC", "TOA", "INDEX"].includes(e.fieldType);
180
+ }
181
+ function H(e) {
182
+ if (!e) return;
183
+ let t = parseInt(e, 10);
184
+ if (!isNaN(t)) return t / 6e4;
185
+ }
186
+ function Ft(e, t) {
187
+ let n = b(e);
188
+ if (n) {
189
+ if (n.type === "gradient" && e) {
190
+ let r = i(e).find(i => i.name === "a:gradFill");
191
+ if (r) return bt(r);
192
+ }
193
+ return n;
194
+ }
195
+ if (e) {
196
+ let o = i(e);
197
+ if (o.find(a => a.name === "a:pattFill")) return {
198
+ type: "pattern"
199
+ };
200
+ if (o.find(a => a.name === "a:blipFill")) return {
201
+ type: "picture"
202
+ };
203
+ }
204
+ if (t) {
205
+ let o = h(t, "a:fillRef");
206
+ if (o) {
207
+ if (j(o, null, "idx") === "0") return {
208
+ type: "none"
209
+ };
210
+ let i = a(o);
211
+ if (i) return {
212
+ type: "solid",
213
+ color: i
214
+ };
215
+ }
216
+ }
217
+ }
218
+ function bt(e) {
219
+ let t = i(e),
220
+ n = "linear",
221
+ o,
222
+ r = t.find(l => l.name === "a:lin");
223
+ if (r) {
224
+ n = "linear";
225
+ let l = j(r, null, "ang");
226
+ l && (o = parseInt(l, 10) / 6e4);
227
+ }
228
+ let i$1 = t.find(l => l.name === "a:path");
229
+ if (i$1) {
230
+ let l = j(i$1, null, "path");
231
+ l === "circle" ? n = "radial" : l === "rect" ? n = "rectangular" : n = "path";
232
+ }
233
+ let a$1 = t.find(l => l.name === "a:gsLst"),
234
+ s = [];
235
+ if (a$1) {
236
+ let l = g(a$1, "gs");
237
+ for (let u of l) {
238
+ let c = j(u, null, "pos"),
239
+ p = c ? parseInt(c, 10) : 0,
240
+ m = a(u);
241
+ m && s.push({
242
+ position: p,
243
+ color: m
244
+ });
245
+ }
246
+ }
247
+ return {
248
+ type: "gradient",
249
+ gradient: {
250
+ type: n,
251
+ angle: o,
252
+ stops: s
253
+ }
254
+ };
255
+ }
256
+ function Et(e, t) {
257
+ let n = e ? h(e, "a:ln") : null;
258
+ if (!n) {
259
+ if (t) {
260
+ let f = h(t, "a:lnRef");
261
+ if (f) {
262
+ if (j(f, null, "idx") === "0") return;
263
+ let g = a(f);
264
+ if (g) return {
265
+ color: g,
266
+ width: 9525
267
+ };
268
+ }
269
+ }
270
+ return;
271
+ }
272
+ let o = i(n);
273
+ if (o.find(f => f.name === "a:noFill")) return;
274
+ let i$1 = {},
275
+ a$1 = j(n, null, "w");
276
+ a$1 && (i$1.width = parseInt(a$1, 10));
277
+ let s = j(n, null, "cap");
278
+ (s === "flat" || s === "rnd" || s === "sq") && (i$1.cap = s === "rnd" ? "round" : s === "sq" ? "square" : "flat");
279
+ let l = o.find(f => f.name === "a:bevel"),
280
+ u = o.find(f => f.name === "a:miter"),
281
+ c = o.find(f => f.name === "a:round");
282
+ l ? i$1.join = "bevel" : c ? i$1.join = "round" : u && (i$1.join = "miter");
283
+ let p = o.find(f => f.name === "a:solidFill");
284
+ p && (i$1.color = a(p));
285
+ let m = o.find(f => f.name === "a:prstDash");
286
+ if (m) {
287
+ let f = j(m, null, "val");
288
+ f && (i$1.style = f);
289
+ }
290
+ let y = o.find(f => f.name === "a:headEnd");
291
+ y && (i$1.headEnd = X(y));
292
+ let T = o.find(f => f.name === "a:tailEnd");
293
+ return T && (i$1.tailEnd = X(T)), i$1;
294
+ }
295
+ function X(e) {
296
+ let t = j(e, null, "type") ?? "none",
297
+ n = j(e, null, "w"),
298
+ o = j(e, null, "len");
299
+ return {
300
+ type: {
301
+ none: "none",
302
+ triangle: "triangle",
303
+ stealth: "stealth",
304
+ diamond: "diamond",
305
+ oval: "oval",
306
+ arrow: "arrow"
307
+ }[t] ?? "none",
308
+ width: n,
309
+ length: o
310
+ };
311
+ }
312
+ function Ct(e) {
313
+ if (!e) return {
314
+ size: {
315
+ width: 0,
316
+ height: 0
317
+ }
318
+ };
319
+ let t = h(e, "a:ext"),
320
+ n = l(t, null, "cx") ?? 0,
321
+ o = l(t, null, "cy") ?? 0,
322
+ r = {
323
+ width: n,
324
+ height: o
325
+ },
326
+ i = h(e, "a:off"),
327
+ a;
328
+ if (i) {
329
+ let m = l(i, null, "x") ?? 0,
330
+ y = l(i, null, "y") ?? 0;
331
+ a = {
332
+ x: m,
333
+ y
334
+ };
335
+ }
336
+ let s = j(e, null, "rot"),
337
+ l$1 = j(e, null, "flipH") === "1",
338
+ u = j(e, null, "flipV") === "1",
339
+ c = H(s),
340
+ p;
341
+ return (c !== void 0 || l$1 || u) && (p = {}, c !== void 0 && (p.rotation = c), l$1 && (p.flipH = true), u && (p.flipV = true)), {
342
+ size: r,
343
+ transform: p,
344
+ offset: a
345
+ };
346
+ }
347
+ function wt(e) {
348
+ if (!e) return "rect";
349
+ let t = h(e, "a:prstGeom");
350
+ if (t) {
351
+ let o = j(t, null, "prst");
352
+ if (o) return o;
353
+ }
354
+ return h(e, "a:custGeom"), "rect";
355
+ }
356
+ function At(e) {
357
+ if (!e) return {};
358
+ let t = {},
359
+ n = j(e, null, "vert");
360
+ (n === "vert" || n === "vert270" || n === "wordArtVert") && (t.vertical = true);
361
+ let o = j(e, null, "rot");
362
+ o && (t.rotation = H(o));
363
+ let r = j(e, null, "anchor");
364
+ if (r) {
365
+ let m = {
366
+ t: "top",
367
+ ctr: "middle",
368
+ b: "bottom",
369
+ dist: "distributed",
370
+ just: "justified"
371
+ };
372
+ t.anchor = m[r];
373
+ }
374
+ j(e, null, "anchorCtr") === "1" && (t.anchorCenter = true);
375
+ let i = h(e, "a:noAutofit"),
376
+ a = h(e, "a:normAutofit"),
377
+ s = h(e, "a:spAutoFit");
378
+ i ? t.autoFit = "none" : a ? t.autoFit = "normal" : s && (t.autoFit = "shape");
379
+ let l$1 = l(e, null, "lIns"),
380
+ u = l(e, null, "rIns"),
381
+ c = l(e, null, "tIns"),
382
+ p = l(e, null, "bIns");
383
+ return (l$1 !== void 0 || u !== void 0 || c !== void 0 || p !== void 0) && (t.margins = {
384
+ left: l$1,
385
+ right: u,
386
+ top: c,
387
+ bottom: p
388
+ }), t;
389
+ }
390
+ function Mt(e) {
391
+ if (!e) return [];
392
+ let t = [],
393
+ n = g(e, "p");
394
+ for (let o of n) t.push({
395
+ type: "paragraph",
396
+ formatting: {},
397
+ content: []
398
+ });
399
+ return t;
400
+ }
401
+ function W(e) {
402
+ let t = i(e),
403
+ n = t.find(g => g.name === "wps:cNvPr"),
404
+ o = t.find(g => g.name === "wps:spPr"),
405
+ r = t.find(g => g.name === "wps:style"),
406
+ i$1 = t.find(g => g.name === "wps:txbx"),
407
+ a = i$1 ? h(i$1, "w:txbxContent") : null,
408
+ s = t.find(g => g.name === "wps:bodyPr"),
409
+ l = wt(o ?? null),
410
+ u = o ? h(o, "a:xfrm") : null,
411
+ {
412
+ size: c,
413
+ transform: p
414
+ } = Ct(u),
415
+ m = Ft(o ?? null, r ?? null),
416
+ y = Et(o ?? null, r ?? null),
417
+ T,
418
+ f;
419
+ n && (T = j(n, null, "id") ?? void 0, f = j(n, null, "name") ?? void 0);
420
+ let S = {
421
+ type: "shape",
422
+ shapeType: l,
423
+ size: c
424
+ };
425
+ if (T && (S.id = T), f && (S.name = f), m && (S.fill = m), y && (S.outline = y), p && (S.transform = p), a || s) {
426
+ let g = At(s ?? null),
427
+ P = Mt(a);
428
+ (P.length > 0 || Object.keys(g).length > 0) && (S.textBody = {
429
+ ...g,
430
+ content: P
431
+ });
432
+ }
433
+ return S;
434
+ }
435
+ function It(e) {
436
+ let n = i(e).find(c => c.name === "wp:inline" || c.name === "wp:anchor");
437
+ if (!n) return null;
438
+ let o = n.name === "wp:anchor",
439
+ r = h(n, "a:graphic");
440
+ if (!r) return null;
441
+ let i$1 = h(r, "a:graphicData");
442
+ if (!i$1) return null;
443
+ let a = h(i$1, "wps:wsp");
444
+ if (!a) return null;
445
+ let s = W(a),
446
+ l$1 = h(n, "wp:extent");
447
+ if (l$1) {
448
+ let c = l(l$1, null, "cx") ?? 0,
449
+ p = l(l$1, null, "cy") ?? 0;
450
+ s.size = {
451
+ width: c,
452
+ height: p
453
+ };
454
+ }
455
+ if (o) {
456
+ let c$1 = c(n);
457
+ c$1 && (s.position = c$1);
458
+ let p = d(n);
459
+ p && (s.wrap = p);
460
+ }
461
+ let u = h(n, "wp:docPr");
462
+ if (u) {
463
+ let c = j(u, null, "id"),
464
+ p = j(u, null, "name");
465
+ c && (s.id = c), p && (s.name = p);
466
+ }
467
+ return s;
468
+ }
469
+ function Rt(e) {
470
+ let n = i(e).find(a => a.name === "wp:inline" || a.name === "wp:anchor");
471
+ if (!n) return false;
472
+ let o = h(n, "a:graphic");
473
+ if (!o) return false;
474
+ let r = h(o, "a:graphicData");
475
+ return r ? h(r, "wps:wsp") !== null : false;
476
+ }
477
+ function Lt(e) {
478
+ return ["line", "straightConnector1", "bentConnector2", "bentConnector3", "bentConnector4", "bentConnector5", "curvedConnector2", "curvedConnector3", "curvedConnector4", "curvedConnector5"].includes(e.shapeType);
479
+ }
480
+ function Dt(e) {
481
+ return e.shapeType === "textBox" || e.textBody !== void 0 && e.textBody.content.length > 0;
482
+ }
483
+ function Pt(e) {
484
+ return e.textBody !== void 0 && e.textBody.content.length > 0;
485
+ }
486
+ function Nt(e$1) {
487
+ return e(e$1.size.width);
488
+ }
489
+ function Bt(e$1) {
490
+ return e(e$1.size.height);
491
+ }
492
+ function vt(e$1) {
493
+ return {
494
+ width: e(e$1.size.width),
495
+ height: e(e$1.size.height)
496
+ };
497
+ }
498
+ function Ot(e) {
499
+ return e.position !== void 0 || e.wrap !== void 0;
500
+ }
501
+ function kt(e) {
502
+ return e.fill !== void 0 && e.fill.type !== "none";
503
+ }
504
+ function Ut(e) {
505
+ return e.outline !== void 0;
506
+ }
507
+ function Xt(e$1) {
508
+ return e$1.outline?.width ? e(e$1.outline.width) : 0;
509
+ }
510
+ function Ht(e) {
511
+ if (!(!e.fill || e.fill.type !== "solid")) return e$1(e.fill.color);
512
+ }
513
+ function Wt(e) {
514
+ if (e.outline?.color) return e$1(e.outline.color);
515
+ }
516
+ var R = 720,
517
+ L = "left",
518
+ Vt = "none";
519
+ function V(e) {
520
+ let t = l(e, "w", "pos"),
521
+ n = j(e, "w", "val");
522
+ if (t === void 0 || !n) return null;
523
+ let o = {
524
+ position: t,
525
+ alignment: n
526
+ },
527
+ r = j(e, "w", "leader");
528
+ return r && (o.leader = r), o;
529
+ }
530
+ function G(e) {
531
+ if (!e) return [];
532
+ let t = f(e, "w", "tab");
533
+ if (t.length === 0) return [];
534
+ let n = [];
535
+ for (let o of t) {
536
+ let r = V(o);
537
+ r && n.push(r);
538
+ }
539
+ return n.sort((o, r) => o.position - r.position), n;
540
+ }
541
+ function Gt(e) {
542
+ if (!e) return;
543
+ let t = e$2(e, "w", "tabs"),
544
+ n = G(t);
545
+ return n.length > 0 ? n : void 0;
546
+ }
547
+ function _t(e, t) {
548
+ if (!e && !t) return [];
549
+ if (!e) return t ?? [];
550
+ if (!t) return [...e];
551
+ let n = new Map();
552
+ for (let r of e) n.set(r.position, r);
553
+ for (let r of t) r.alignment === "clear" ? n.delete(r.position) : n.set(r.position, r);
554
+ let o = Array.from(n.values());
555
+ return o.sort((r, i) => r.position - i.position), o;
556
+ }
557
+ function D(e, t, n) {
558
+ for (let r of t) if (r.position > e && r.alignment !== "clear") return r;
559
+ let o = Math.ceil((e + 1) / R) * R;
560
+ return o > n ? {
561
+ position: n,
562
+ alignment: L
563
+ } : {
564
+ position: o,
565
+ alignment: L
566
+ };
567
+ }
568
+ function jt(e, t, n) {
569
+ let o = D(e, t, n);
570
+ return Math.max(0, o.position - e);
571
+ }
572
+ function zt(e, t, n, o = 0) {
573
+ let r = D(e, t, n),
574
+ i;
575
+ switch (r.alignment) {
576
+ case "right":
577
+ i = Math.max(0, r.position - e - o);
578
+ break;
579
+ case "center":
580
+ i = Math.max(0, r.position - e - o / 2);
581
+ break;
582
+ case "decimal":
583
+ i = Math.max(0, r.position - e - o);
584
+ break;
585
+ case "bar":
586
+ i = Math.max(0, r.position - e);
587
+ break;
588
+ default:
589
+ i = Math.max(0, r.position - e);
590
+ break;
591
+ }
592
+ return {
593
+ width: i,
594
+ alignment: r.alignment
595
+ };
596
+ }
597
+ function Kt(e) {
598
+ switch (e) {
599
+ case "dot":
600
+ return ".";
601
+ case "hyphen":
602
+ return "-";
603
+ case "underscore":
604
+ return "_";
605
+ case "heavy":
606
+ return "_";
607
+ case "middleDot":
608
+ return "\xB7";
609
+ default:
610
+ return " ";
611
+ }
612
+ }
613
+ function Yt(e) {
614
+ return e !== void 0 && e !== "none";
615
+ }
616
+ function Jt(e, t) {
617
+ let n = t.filter(i => i.parentId != null);
618
+ if (n.length === 0) return;
619
+ let o = new Map();
620
+ for (let i of n) {
621
+ let a = o.get(i.parentId);
622
+ a ? a.push(i.id) : o.set(i.parentId, [i.id]);
623
+ }
624
+ function r(i) {
625
+ for (let a of i) if (a.type === "paragraph") {
626
+ if (!a.content.some(l => l.type === "commentRangeStart" || l.type === "commentRangeEnd")) continue;
627
+ let s = [];
628
+ for (let l of a.content) if (l.type === "commentRangeStart") {
629
+ s.push(l);
630
+ let u = o.get(l.id);
631
+ if (u) for (let c of u) s.push({
632
+ type: "commentRangeStart",
633
+ id: c
634
+ });
635
+ } else if (l.type === "commentRangeEnd") {
636
+ s.push(l);
637
+ let u = o.get(l.id);
638
+ if (u) for (let c of u) s.push({
639
+ type: "commentRangeEnd",
640
+ id: c
641
+ });
642
+ } else s.push(l);
643
+ a.content = s;
644
+ } else if (a.type === "table") for (let s of a.rows) for (let l of s.cells) r(l.content);
645
+ }
646
+ r(e);
647
+ }
648
+ function Zt(e, t) {
649
+ let n = new Set(t.map(a => a.id)),
650
+ o = t.filter(a => a.parentId != null && !n.has(a.parentId));
651
+ if (o.length === 0) return;
652
+ let r = new Map();
653
+ for (let a of o) {
654
+ let s = r.get(a.parentId);
655
+ s ? s.push(a.id) : r.set(a.parentId, [a.id]);
656
+ }
657
+ function i(a) {
658
+ for (let s of a) if (s.type === "paragraph") {
659
+ if (!s.content.some(p => (p.type === "insertion" || p.type === "deletion") && r.has(p.info.id))) continue;
660
+ let u = [],
661
+ c = s.content;
662
+ for (let p = 0; p < c.length; p++) {
663
+ let m = c[p];
664
+ if ((m.type === "insertion" || m.type === "deletion") && r.has(m.info.id)) {
665
+ let y = r.get(m.info.id);
666
+ for (let f of y) u.push({
667
+ type: "commentRangeStart",
668
+ id: f
669
+ });
670
+ u.push(m);
671
+ let T = c[p + 1];
672
+ T && (T.type === "insertion" || T.type === "deletion") && T.type !== m.type && T.info.author === m.info.author && T.info.date === m.info.date && (u.push(T), p++);
673
+ for (let f of y) u.push({
674
+ type: "commentRangeEnd",
675
+ id: f
676
+ });
677
+ } else u.push(m);
678
+ }
679
+ s.content = u;
680
+ } else if (s.type === "table") for (let l of s.rows) for (let u of l.cells) i(u.content);
681
+ }
682
+ i(e);
683
+ }
684
+
685
+
686
+ /***/ })
687
+
688
+ }]);