@pravinrd/awesome-grid 0.2.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.
@@ -0,0 +1,1084 @@
1
+ function q(e, t, r, i, n) {
2
+ i = i || {};
3
+ var a = 1.15, s = n.internal.scaleFactor, h = n.internal.getFontSize() / s, f = n.getLineHeightFactor ? n.getLineHeightFactor() : a, o = h * f, l = /\r\n|\r|\n/g, g = "", u = 1;
4
+ if ((i.valign === "middle" || i.valign === "bottom" || i.halign === "center" || i.halign === "right") && (g = typeof e == "string" ? e.split(l) : e, u = g.length || 1), r += h * (2 - a), i.valign === "middle" ? r -= u / 2 * o : i.valign === "bottom" && (r -= u * o), i.halign === "center" || i.halign === "right") {
5
+ var v = h;
6
+ if (i.halign === "center" && (v *= 0.5), g && u >= 1) {
7
+ for (var d = 0; d < g.length; d++)
8
+ n.text(g[d], t - n.getStringUnitWidth(g[d]) * v, r), r += o;
9
+ return n;
10
+ }
11
+ t -= n.getStringUnitWidth(e) * v;
12
+ }
13
+ return i.halign === "justify" ? n.text(e, t, r, { maxWidth: i.maxWidth || 100, align: "justify" }) : n.text(e, t, r), n;
14
+ }
15
+ var M = {}, P = (
16
+ /** @class */
17
+ (function() {
18
+ function e(t) {
19
+ this.jsPDFDocument = t, this.userStyles = {
20
+ // Black for versions of jspdf without getTextColor
21
+ textColor: t.getTextColor ? this.jsPDFDocument.getTextColor() : 0,
22
+ fontSize: t.internal.getFontSize(),
23
+ fontStyle: t.internal.getFont().fontStyle,
24
+ font: t.internal.getFont().fontName,
25
+ // 0 for versions of jspdf without getLineWidth
26
+ lineWidth: t.getLineWidth ? this.jsPDFDocument.getLineWidth() : 0,
27
+ // Black for versions of jspdf without getDrawColor
28
+ lineColor: t.getDrawColor ? this.jsPDFDocument.getDrawColor() : 0
29
+ };
30
+ }
31
+ return e.setDefaults = function(t, r) {
32
+ r === void 0 && (r = null), r ? r.__autoTableDocumentDefaults = t : M = t;
33
+ }, e.unifyColor = function(t) {
34
+ return Array.isArray(t) ? t : typeof t == "number" ? [t, t, t] : typeof t == "string" ? [t] : null;
35
+ }, e.prototype.applyStyles = function(t, r) {
36
+ var i, n, a;
37
+ r === void 0 && (r = !1), t.fontStyle && this.jsPDFDocument.setFontStyle && this.jsPDFDocument.setFontStyle(t.fontStyle);
38
+ var s = this.jsPDFDocument.internal.getFont(), h = s.fontStyle, f = s.fontName;
39
+ if (t.font && (f = t.font), t.fontStyle) {
40
+ h = t.fontStyle;
41
+ var o = this.getFontList()[f];
42
+ o && o.indexOf(h) === -1 && this.jsPDFDocument.setFontStyle && (this.jsPDFDocument.setFontStyle(o[0]), h = o[0]);
43
+ }
44
+ if (this.jsPDFDocument.setFont(f, h), t.fontSize && this.jsPDFDocument.setFontSize(t.fontSize), !r) {
45
+ var l = e.unifyColor(t.fillColor);
46
+ l && (i = this.jsPDFDocument).setFillColor.apply(i, l), l = e.unifyColor(t.textColor), l && (n = this.jsPDFDocument).setTextColor.apply(n, l), l = e.unifyColor(t.lineColor), l && (a = this.jsPDFDocument).setDrawColor.apply(a, l), typeof t.lineWidth == "number" && this.jsPDFDocument.setLineWidth(t.lineWidth);
47
+ }
48
+ }, e.prototype.splitTextToSize = function(t, r, i) {
49
+ return this.jsPDFDocument.splitTextToSize(t, r, i);
50
+ }, e.prototype.rect = function(t, r, i, n, a) {
51
+ return this.jsPDFDocument.rect(t, r, i, n, a);
52
+ }, e.prototype.getLastAutoTable = function() {
53
+ return this.jsPDFDocument.lastAutoTable || null;
54
+ }, e.prototype.getTextWidth = function(t) {
55
+ return this.jsPDFDocument.getTextWidth(t);
56
+ }, e.prototype.getDocument = function() {
57
+ return this.jsPDFDocument;
58
+ }, e.prototype.setPage = function(t) {
59
+ this.jsPDFDocument.setPage(t);
60
+ }, e.prototype.addPage = function() {
61
+ return this.jsPDFDocument.addPage();
62
+ }, e.prototype.getFontList = function() {
63
+ return this.jsPDFDocument.getFontList();
64
+ }, e.prototype.getGlobalOptions = function() {
65
+ return M || {};
66
+ }, e.prototype.getDocumentOptions = function() {
67
+ return this.jsPDFDocument.__autoTableDocumentDefaults || {};
68
+ }, e.prototype.pageSize = function() {
69
+ var t = this.jsPDFDocument.internal.pageSize;
70
+ return t.width == null && (t = { width: t.getWidth(), height: t.getHeight() }), t;
71
+ }, e.prototype.scaleFactor = function() {
72
+ return this.jsPDFDocument.internal.scaleFactor;
73
+ }, e.prototype.getLineHeightFactor = function() {
74
+ var t = this.jsPDFDocument;
75
+ return t.getLineHeightFactor ? t.getLineHeightFactor() : 1.15;
76
+ }, e.prototype.getLineHeight = function(t) {
77
+ return t / this.scaleFactor() * this.getLineHeightFactor();
78
+ }, e.prototype.pageNumber = function() {
79
+ var t = this.jsPDFDocument.internal.getCurrentPageInfo();
80
+ return t ? t.pageNumber : this.jsPDFDocument.internal.getNumberOfPages();
81
+ }, e;
82
+ })()
83
+ ), z = function(e, t) {
84
+ return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, i) {
85
+ r.__proto__ = i;
86
+ } || function(r, i) {
87
+ for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (r[n] = i[n]);
88
+ }, z(e, t);
89
+ };
90
+ function G(e, t) {
91
+ if (typeof t != "function" && t !== null)
92
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
93
+ z(e, t);
94
+ function r() {
95
+ this.constructor = e;
96
+ }
97
+ e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
98
+ }
99
+ var J = (
100
+ /** @class */
101
+ (function(e) {
102
+ G(t, e);
103
+ function t(r) {
104
+ var i = e.call(this) || this;
105
+ return i._element = r, i;
106
+ }
107
+ return t;
108
+ })(Array)
109
+ );
110
+ function nt(e) {
111
+ return {
112
+ font: "helvetica",
113
+ // helvetica, times, courier
114
+ fontStyle: "normal",
115
+ // normal, bold, italic, bolditalic
116
+ overflow: "linebreak",
117
+ // linebreak, ellipsize, visible or hidden
118
+ fillColor: !1,
119
+ // Either false for transparent, rbg array e.g. [255, 255, 255] or gray level e.g 200
120
+ textColor: 20,
121
+ halign: "left",
122
+ // left, center, right, justify
123
+ valign: "top",
124
+ // top, middle, bottom
125
+ fontSize: 10,
126
+ cellPadding: 5 / e,
127
+ // number or {top,left,right,left,vertical,horizontal}
128
+ lineColor: 200,
129
+ lineWidth: 0,
130
+ cellWidth: "auto",
131
+ // 'auto'|'wrap'|number
132
+ minCellHeight: 0,
133
+ minCellWidth: 0
134
+ };
135
+ }
136
+ function at(e) {
137
+ var t = {
138
+ striped: {
139
+ table: { fillColor: 255, textColor: 80, fontStyle: "normal" },
140
+ head: { textColor: 255, fillColor: [41, 128, 185], fontStyle: "bold" },
141
+ body: {},
142
+ foot: { textColor: 255, fillColor: [41, 128, 185], fontStyle: "bold" },
143
+ alternateRow: { fillColor: 245 }
144
+ },
145
+ grid: {
146
+ table: {
147
+ fillColor: 255,
148
+ textColor: 80,
149
+ fontStyle: "normal",
150
+ lineWidth: 0.1
151
+ },
152
+ head: {
153
+ textColor: 255,
154
+ fillColor: [26, 188, 156],
155
+ fontStyle: "bold",
156
+ lineWidth: 0
157
+ },
158
+ body: {},
159
+ foot: {
160
+ textColor: 255,
161
+ fillColor: [26, 188, 156],
162
+ fontStyle: "bold",
163
+ lineWidth: 0
164
+ },
165
+ alternateRow: {}
166
+ },
167
+ plain: { head: { fontStyle: "bold" }, foot: { fontStyle: "bold" } }
168
+ };
169
+ return t[e];
170
+ }
171
+ function D(e, t, r) {
172
+ r.applyStyles(t, !0);
173
+ var i = Array.isArray(e) ? e : [e], n = i.map(function(a) {
174
+ return r.getTextWidth(a);
175
+ }).reduce(function(a, s) {
176
+ return Math.max(a, s);
177
+ }, 0);
178
+ return n;
179
+ }
180
+ function U(e, t, r, i) {
181
+ var n = t.settings.tableLineWidth, a = t.settings.tableLineColor;
182
+ e.applyStyles({ lineWidth: n, lineColor: a });
183
+ var s = $(n, !1);
184
+ s && e.rect(r.x, r.y, t.getWidth(e.pageSize().width), i.y - r.y, s);
185
+ }
186
+ function $(e, t) {
187
+ var r = e > 0, i = t || t === 0;
188
+ return r && i ? "DF" : r ? "S" : i ? "F" : null;
189
+ }
190
+ function F(e, t) {
191
+ var r, i, n, a;
192
+ if (e = e || t, Array.isArray(e)) {
193
+ if (e.length >= 4)
194
+ return {
195
+ top: e[0],
196
+ right: e[1],
197
+ bottom: e[2],
198
+ left: e[3]
199
+ };
200
+ if (e.length === 3)
201
+ return {
202
+ top: e[0],
203
+ right: e[1],
204
+ bottom: e[2],
205
+ left: e[1]
206
+ };
207
+ if (e.length === 2)
208
+ return {
209
+ top: e[0],
210
+ right: e[1],
211
+ bottom: e[0],
212
+ left: e[1]
213
+ };
214
+ e.length === 1 ? e = e[0] : e = t;
215
+ }
216
+ return typeof e == "object" ? (typeof e.vertical == "number" && (e.top = e.vertical, e.bottom = e.vertical), typeof e.horizontal == "number" && (e.right = e.horizontal, e.left = e.horizontal), {
217
+ left: (r = e.left) !== null && r !== void 0 ? r : t,
218
+ top: (i = e.top) !== null && i !== void 0 ? i : t,
219
+ right: (n = e.right) !== null && n !== void 0 ? n : t,
220
+ bottom: (a = e.bottom) !== null && a !== void 0 ? a : t
221
+ }) : (typeof e != "number" && (e = t), { top: e, right: e, bottom: e, left: e });
222
+ }
223
+ function Q(e, t) {
224
+ var r = F(t.settings.margin, 0);
225
+ return e.pageSize().width - (r.left + r.right);
226
+ }
227
+ function ot(e, t, r, i, n) {
228
+ var a = {}, s = 1.3333333333333333, h = b(t, function(c) {
229
+ return n.getComputedStyle(c).backgroundColor;
230
+ });
231
+ h != null && (a.fillColor = h);
232
+ var f = b(t, function(c) {
233
+ return n.getComputedStyle(c).color;
234
+ });
235
+ f != null && (a.textColor = f);
236
+ var o = ht(i, r);
237
+ o && (a.cellPadding = o);
238
+ var l = "borderTopColor", g = s * r, u = i.borderTopWidth;
239
+ if (i.borderBottomWidth === u && i.borderRightWidth === u && i.borderLeftWidth === u) {
240
+ var v = (parseFloat(u) || 0) / g;
241
+ v && (a.lineWidth = v);
242
+ } else
243
+ a.lineWidth = {
244
+ top: (parseFloat(i.borderTopWidth) || 0) / g,
245
+ right: (parseFloat(i.borderRightWidth) || 0) / g,
246
+ bottom: (parseFloat(i.borderBottomWidth) || 0) / g,
247
+ left: (parseFloat(i.borderLeftWidth) || 0) / g
248
+ }, a.lineWidth.top || (a.lineWidth.right ? l = "borderRightColor" : a.lineWidth.bottom ? l = "borderBottomColor" : a.lineWidth.left && (l = "borderLeftColor"));
249
+ var d = b(t, function(c) {
250
+ return n.getComputedStyle(c)[l];
251
+ });
252
+ d != null && (a.lineColor = d);
253
+ var m = ["left", "right", "center", "justify"];
254
+ m.indexOf(i.textAlign) !== -1 && (a.halign = i.textAlign), m = ["middle", "bottom", "top"], m.indexOf(i.verticalAlign) !== -1 && (a.valign = i.verticalAlign);
255
+ var p = parseInt(i.fontSize || "");
256
+ isNaN(p) || (a.fontSize = p / s);
257
+ var y = st(i);
258
+ y && (a.fontStyle = y);
259
+ var x = (i.fontFamily || "").toLowerCase();
260
+ return e.indexOf(x) !== -1 && (a.font = x), a;
261
+ }
262
+ function st(e) {
263
+ var t = "";
264
+ return (e.fontWeight === "bold" || e.fontWeight === "bolder" || parseInt(e.fontWeight) >= 700) && (t = "bold"), (e.fontStyle === "italic" || e.fontStyle === "oblique") && (t += "italic"), t;
265
+ }
266
+ function b(e, t) {
267
+ var r = X(e, t);
268
+ if (!r)
269
+ return null;
270
+ var i = r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);
271
+ if (!i || !Array.isArray(i))
272
+ return null;
273
+ var n = [
274
+ parseInt(i[1]),
275
+ parseInt(i[2]),
276
+ parseInt(i[3])
277
+ ], a = parseInt(i[4]);
278
+ return a === 0 || isNaN(n[0]) || isNaN(n[1]) || isNaN(n[2]) ? null : n;
279
+ }
280
+ function X(e, t) {
281
+ var r = t(e);
282
+ return r === "rgba(0, 0, 0, 0)" || r === "transparent" || r === "initial" || r === "inherit" ? e.parentElement == null ? null : X(e.parentElement, t) : r;
283
+ }
284
+ function ht(e, t) {
285
+ var r = [
286
+ e.paddingTop,
287
+ e.paddingRight,
288
+ e.paddingBottom,
289
+ e.paddingLeft
290
+ ], i = 96 / (72 / t), n = (parseInt(e.lineHeight) - parseInt(e.fontSize)) / t / 2, a = r.map(function(h) {
291
+ return parseInt(h || "0") / i;
292
+ }), s = F(a, 0);
293
+ return n > s.top && (s.top = n), n > s.bottom && (s.bottom = n), s;
294
+ }
295
+ function Z(e, t, r, i, n) {
296
+ var a, s;
297
+ i === void 0 && (i = !1), n === void 0 && (n = !1);
298
+ var h;
299
+ typeof t == "string" ? h = r.document.querySelector(t) : h = t;
300
+ var f = Object.keys(e.getFontList()), o = e.scaleFactor(), l = [], g = [], u = [];
301
+ if (!h)
302
+ return console.error("Html table could not be found with input: ", t), { head: l, body: g, foot: u };
303
+ for (var v = 0; v < h.rows.length; v++) {
304
+ var d = h.rows[v], m = (s = (a = d?.parentElement) === null || a === void 0 ? void 0 : a.tagName) === null || s === void 0 ? void 0 : s.toLowerCase(), p = ft(f, o, r, d, i, n);
305
+ p && (m === "thead" ? l.push(p) : m === "tfoot" ? u.push(p) : g.push(p));
306
+ }
307
+ return { head: l, body: g, foot: u };
308
+ }
309
+ function ft(e, t, r, i, n, a) {
310
+ for (var s = new J(i), h = 0; h < i.cells.length; h++) {
311
+ var f = i.cells[h], o = r.getComputedStyle(f);
312
+ if (n || o.display !== "none") {
313
+ var l = void 0;
314
+ a && (l = ot(e, f, t, o, r)), s.push({
315
+ rowSpan: f.rowSpan,
316
+ colSpan: f.colSpan,
317
+ styles: l,
318
+ _element: f,
319
+ content: lt(f)
320
+ });
321
+ }
322
+ }
323
+ var g = r.getComputedStyle(i);
324
+ if (s.length > 0 && (n || g.display !== "none"))
325
+ return s;
326
+ }
327
+ function lt(e) {
328
+ var t = e.cloneNode(!0);
329
+ return t.innerHTML = t.innerHTML.replace(/\n/g, "").replace(/ +/g, " "), t.innerHTML = t.innerHTML.split(/<br.*?>/).map(function(r) {
330
+ return r.trim();
331
+ }).join(`
332
+ `), t.innerText || t.textContent || "";
333
+ }
334
+ function gt(e, t, r) {
335
+ for (var i = 0, n = [e, t, r]; i < n.length; i++) {
336
+ var a = n[i];
337
+ a && typeof a != "object" && console.error("The options parameter should be of type object, is: " + typeof a), a.startY && typeof a.startY != "number" && (console.error("Invalid value for startY option", a.startY), delete a.startY);
338
+ }
339
+ }
340
+ function w(e, t, r, i, n) {
341
+ if (e == null)
342
+ throw new TypeError("Cannot convert undefined or null to object");
343
+ for (var a = Object(e), s = 1; s < arguments.length; s++) {
344
+ var h = arguments[s];
345
+ if (h != null)
346
+ for (var f in h)
347
+ Object.prototype.hasOwnProperty.call(h, f) && (a[f] = h[f]);
348
+ }
349
+ return a;
350
+ }
351
+ function B(e, t) {
352
+ var r = new P(e), i = r.getDocumentOptions(), n = r.getGlobalOptions();
353
+ gt(n, i, t);
354
+ var a = w({}, n, i, t), s;
355
+ typeof window < "u" && (s = window);
356
+ var h = ut(n, i, t), f = vt(n, i, t), o = dt(r, a), l = yt(r, a, s);
357
+ return { id: t.tableId, content: l, hooks: f, styles: h, settings: o };
358
+ }
359
+ function ut(e, t, r) {
360
+ for (var i = {
361
+ styles: {},
362
+ headStyles: {},
363
+ bodyStyles: {},
364
+ footStyles: {},
365
+ alternateRowStyles: {},
366
+ columnStyles: {}
367
+ }, n = function(f) {
368
+ if (f === "columnStyles") {
369
+ var o = e[f], l = t[f], g = r[f];
370
+ i.columnStyles = w({}, o, l, g);
371
+ } else {
372
+ var u = [e, t, r], v = u.map(function(d) {
373
+ return d[f] || {};
374
+ });
375
+ i[f] = w({}, v[0], v[1], v[2]);
376
+ }
377
+ }, a = 0, s = Object.keys(i); a < s.length; a++) {
378
+ var h = s[a];
379
+ n(h);
380
+ }
381
+ return i;
382
+ }
383
+ function vt(e, t, r) {
384
+ for (var i = [e, t, r], n = {
385
+ didParseCell: [],
386
+ willDrawCell: [],
387
+ didDrawCell: [],
388
+ willDrawPage: [],
389
+ didDrawPage: []
390
+ }, a = 0, s = i; a < s.length; a++) {
391
+ var h = s[a];
392
+ h.didParseCell && n.didParseCell.push(h.didParseCell), h.willDrawCell && n.willDrawCell.push(h.willDrawCell), h.didDrawCell && n.didDrawCell.push(h.didDrawCell), h.willDrawPage && n.willDrawPage.push(h.willDrawPage), h.didDrawPage && n.didDrawPage.push(h.didDrawPage);
393
+ }
394
+ return n;
395
+ }
396
+ function dt(e, t) {
397
+ var r, i, n, a, s, h, f, o, l, g, u, v, d = F(t.margin, 40 / e.scaleFactor()), m = (r = pt(e, t.startY)) !== null && r !== void 0 ? r : d.top, p;
398
+ t.showFoot === !0 ? p = "everyPage" : t.showFoot === !1 ? p = "never" : p = (i = t.showFoot) !== null && i !== void 0 ? i : "everyPage";
399
+ var y;
400
+ t.showHead === !0 ? y = "everyPage" : t.showHead === !1 ? y = "never" : y = (n = t.showHead) !== null && n !== void 0 ? n : "everyPage";
401
+ var x = (a = t.useCss) !== null && a !== void 0 ? a : !1, c = t.theme || (x ? "plain" : "striped"), C = !!t.horizontalPageBreak, rt = (s = t.horizontalPageBreakRepeat) !== null && s !== void 0 ? s : null;
402
+ return {
403
+ includeHiddenHtml: (h = t.includeHiddenHtml) !== null && h !== void 0 ? h : !1,
404
+ useCss: x,
405
+ theme: c,
406
+ startY: m,
407
+ margin: d,
408
+ pageBreak: (f = t.pageBreak) !== null && f !== void 0 ? f : "auto",
409
+ rowPageBreak: (o = t.rowPageBreak) !== null && o !== void 0 ? o : "auto",
410
+ tableWidth: (l = t.tableWidth) !== null && l !== void 0 ? l : "auto",
411
+ showHead: y,
412
+ showFoot: p,
413
+ tableLineWidth: (g = t.tableLineWidth) !== null && g !== void 0 ? g : 0,
414
+ tableLineColor: (u = t.tableLineColor) !== null && u !== void 0 ? u : 200,
415
+ horizontalPageBreak: C,
416
+ horizontalPageBreakRepeat: rt,
417
+ horizontalPageBreakBehaviour: (v = t.horizontalPageBreakBehaviour) !== null && v !== void 0 ? v : "afterAllRows"
418
+ };
419
+ }
420
+ function pt(e, t) {
421
+ var r = e.getLastAutoTable(), i = e.scaleFactor(), n = e.pageNumber(), a = !1;
422
+ if (r && r.startPageNumber) {
423
+ var s = r.startPageNumber + r.pageNumber - 1;
424
+ a = s === n;
425
+ }
426
+ return typeof t == "number" ? t : (t == null || t === !1) && a && r?.finalY != null ? r.finalY + 20 / i : null;
427
+ }
428
+ function yt(e, t, r) {
429
+ var i = t.head || [], n = t.body || [], a = t.foot || [];
430
+ if (t.html) {
431
+ var s = t.includeHiddenHtml;
432
+ if (r) {
433
+ var h = Z(e, t.html, r, s, t.useCss) || {};
434
+ i = h.head || i, n = h.body || i, a = h.foot || i;
435
+ } else
436
+ console.error("Cannot parse html in non browser environment");
437
+ }
438
+ var f = t.columns || mt(i, n, a);
439
+ return { columns: f, head: i, body: n, foot: a };
440
+ }
441
+ function mt(e, t, r) {
442
+ var i = e[0] || t[0] || r[0] || [], n = [];
443
+ return Object.keys(i).filter(function(a) {
444
+ return a !== "_element";
445
+ }).forEach(function(a) {
446
+ var s = 1, h;
447
+ Array.isArray(i) ? h = i[parseInt(a)] : h = i[a], typeof h == "object" && !Array.isArray(h) && (s = h?.colSpan || 1);
448
+ for (var f = 0; f < s; f++) {
449
+ var o = void 0;
450
+ Array.isArray(i) ? o = n.length : o = a + (f > 0 ? "_".concat(f) : "");
451
+ var l = { dataKey: o };
452
+ n.push(l);
453
+ }
454
+ }), n;
455
+ }
456
+ var A = (
457
+ /** @class */
458
+ /* @__PURE__ */ (function() {
459
+ function e(t, r, i) {
460
+ this.table = r, this.pageNumber = r.pageNumber, this.settings = r.settings, this.cursor = i, this.doc = t.getDocument();
461
+ }
462
+ return e;
463
+ })()
464
+ ), ct = (
465
+ /** @class */
466
+ (function(e) {
467
+ G(t, e);
468
+ function t(r, i, n, a, s, h) {
469
+ var f = e.call(this, r, i, h) || this;
470
+ return f.cell = n, f.row = a, f.column = s, f.section = a.section, f;
471
+ }
472
+ return t;
473
+ })(A)
474
+ ), wt = (
475
+ /** @class */
476
+ (function() {
477
+ function e(t, r) {
478
+ this.pageNumber = 1, this.id = t.id, this.settings = t.settings, this.styles = t.styles, this.hooks = t.hooks, this.columns = r.columns, this.head = r.head, this.body = r.body, this.foot = r.foot;
479
+ }
480
+ return e.prototype.getHeadHeight = function(t) {
481
+ return this.head.reduce(function(r, i) {
482
+ return r + i.getMaxCellHeight(t);
483
+ }, 0);
484
+ }, e.prototype.getFootHeight = function(t) {
485
+ return this.foot.reduce(function(r, i) {
486
+ return r + i.getMaxCellHeight(t);
487
+ }, 0);
488
+ }, e.prototype.allRows = function() {
489
+ return this.head.concat(this.body).concat(this.foot);
490
+ }, e.prototype.callCellHooks = function(t, r, i, n, a, s) {
491
+ for (var h = 0, f = r; h < f.length; h++) {
492
+ var o = f[h], l = new ct(t, this, i, n, a, s), g = o(l) === !1;
493
+ if (i.text = Array.isArray(i.text) ? i.text : [i.text], g)
494
+ return !1;
495
+ }
496
+ return !0;
497
+ }, e.prototype.callEndPageHooks = function(t, r) {
498
+ t.applyStyles(t.userStyles);
499
+ for (var i = 0, n = this.hooks.didDrawPage; i < n.length; i++) {
500
+ var a = n[i];
501
+ a(new A(t, this, r));
502
+ }
503
+ }, e.prototype.callWillDrawPageHooks = function(t, r) {
504
+ for (var i = 0, n = this.hooks.willDrawPage; i < n.length; i++) {
505
+ var a = n[i];
506
+ a(new A(t, this, r));
507
+ }
508
+ }, e.prototype.getWidth = function(t) {
509
+ if (typeof this.settings.tableWidth == "number")
510
+ return this.settings.tableWidth;
511
+ if (this.settings.tableWidth === "wrap") {
512
+ var r = this.columns.reduce(function(n, a) {
513
+ return n + a.wrappedWidth;
514
+ }, 0);
515
+ return r;
516
+ } else {
517
+ var i = this.settings.margin;
518
+ return t - i.left - i.right;
519
+ }
520
+ }, e;
521
+ })()
522
+ ), V = (
523
+ /** @class */
524
+ (function() {
525
+ function e(t, r, i, n, a) {
526
+ a === void 0 && (a = !1), this.height = 0, this.raw = t, t instanceof J && (this.raw = t._element, this.element = t._element), this.index = r, this.section = i, this.cells = n, this.spansMultiplePages = a;
527
+ }
528
+ return e.prototype.getMaxCellHeight = function(t) {
529
+ var r = this;
530
+ return t.reduce(function(i, n) {
531
+ var a;
532
+ return Math.max(i, ((a = r.cells[n.index]) === null || a === void 0 ? void 0 : a.height) || 0);
533
+ }, 0);
534
+ }, e.prototype.hasRowSpan = function(t) {
535
+ var r = this;
536
+ return t.filter(function(i) {
537
+ var n = r.cells[i.index];
538
+ return n ? n.rowSpan > 1 : !1;
539
+ }).length > 0;
540
+ }, e.prototype.canEntireRowFit = function(t, r) {
541
+ return this.getMaxCellHeight(r) <= t;
542
+ }, e.prototype.getMinimumRowHeight = function(t, r) {
543
+ var i = this;
544
+ return t.reduce(function(n, a) {
545
+ var s = i.cells[a.index];
546
+ if (!s)
547
+ return 0;
548
+ var h = r.getLineHeight(s.styles.fontSize), f = s.padding("vertical"), o = f + h;
549
+ return o > n ? o : n;
550
+ }, 0);
551
+ }, e;
552
+ })()
553
+ ), tt = (
554
+ /** @class */
555
+ (function() {
556
+ function e(t, r, i) {
557
+ var n;
558
+ this.contentHeight = 0, this.contentWidth = 0, this.wrappedWidth = 0, this.minReadableWidth = 0, this.minWidth = 0, this.width = 0, this.height = 0, this.x = 0, this.y = 0, this.styles = r, this.section = i, this.raw = t;
559
+ var a = t;
560
+ t != null && typeof t == "object" && !Array.isArray(t) ? (this.rowSpan = t.rowSpan || 1, this.colSpan = t.colSpan || 1, a = (n = t.content) !== null && n !== void 0 ? n : t, t._element && (this.raw = t._element)) : (this.rowSpan = 1, this.colSpan = 1);
561
+ var s = a != null ? "" + a : "", h = /\r\n|\r|\n/g;
562
+ this.text = s.split(h);
563
+ }
564
+ return e.prototype.getTextPos = function() {
565
+ var t;
566
+ if (this.styles.valign === "top")
567
+ t = this.y + this.padding("top");
568
+ else if (this.styles.valign === "bottom")
569
+ t = this.y + this.height - this.padding("bottom");
570
+ else {
571
+ var r = this.height - this.padding("vertical");
572
+ t = this.y + r / 2 + this.padding("top");
573
+ }
574
+ var i;
575
+ if (this.styles.halign === "right")
576
+ i = this.x + this.width - this.padding("right");
577
+ else if (this.styles.halign === "center") {
578
+ var n = this.width - this.padding("horizontal");
579
+ i = this.x + n / 2 + this.padding("left");
580
+ } else
581
+ i = this.x + this.padding("left");
582
+ return { x: i, y: t };
583
+ }, e.prototype.getContentHeight = function(t, r) {
584
+ r === void 0 && (r = 1.15);
585
+ var i = Array.isArray(this.text) ? this.text.length : 1, n = this.styles.fontSize / t * r, a = i * n + this.padding("vertical");
586
+ return Math.max(a, this.styles.minCellHeight);
587
+ }, e.prototype.padding = function(t) {
588
+ var r = F(this.styles.cellPadding, 0);
589
+ return t === "vertical" ? r.top + r.bottom : t === "horizontal" ? r.left + r.right : r[t];
590
+ }, e;
591
+ })()
592
+ ), St = (
593
+ /** @class */
594
+ (function() {
595
+ function e(t, r, i) {
596
+ this.wrappedWidth = 0, this.minReadableWidth = 0, this.minWidth = 0, this.width = 0, this.dataKey = t, this.raw = r, this.index = i;
597
+ }
598
+ return e.prototype.getMaxCustomCellWidth = function(t) {
599
+ for (var r = 0, i = 0, n = t.allRows(); i < n.length; i++) {
600
+ var a = n[i], s = a.cells[this.index];
601
+ s && typeof s.styles.cellWidth == "number" && (r = Math.max(r, s.styles.cellWidth));
602
+ }
603
+ return r;
604
+ }, e;
605
+ })()
606
+ );
607
+ function xt(e, t) {
608
+ Ct(e, t);
609
+ var r = [], i = 0;
610
+ t.columns.forEach(function(a) {
611
+ var s = a.getMaxCustomCellWidth(t);
612
+ s ? a.width = s : (a.width = a.wrappedWidth, r.push(a)), i += a.width;
613
+ });
614
+ var n = t.getWidth(e.pageSize().width) - i;
615
+ n && (n = j(r, n, function(a) {
616
+ return Math.max(a.minReadableWidth, a.minWidth);
617
+ })), n && (n = j(r, n, function(a) {
618
+ return a.minWidth;
619
+ })), n = Math.abs(n), !t.settings.horizontalPageBreak && n > 0.1 / e.scaleFactor() && (n = n < 1 ? n : Math.round(n), console.log("Of the table content, ".concat(n, " units width could not fit page"))), Ht(t), Dt(t, e), Pt(t);
620
+ }
621
+ function Ct(e, t) {
622
+ var r = e.scaleFactor(), i = t.settings.horizontalPageBreak, n = Q(e, t);
623
+ t.allRows().forEach(function(a) {
624
+ for (var s = 0, h = t.columns; s < h.length; s++) {
625
+ var f = h[s], o = a.cells[f.index];
626
+ if (o) {
627
+ var l = t.hooks.didParseCell;
628
+ t.callCellHooks(e, l, o, a, f, null);
629
+ var g = o.padding("horizontal");
630
+ o.contentWidth = D(o.text, o.styles, e) + g;
631
+ var u = D(o.text.join(" ").split(/[^\S\u00A0]+/), o.styles, e);
632
+ if (o.minReadableWidth = u + o.padding("horizontal"), typeof o.styles.cellWidth == "number")
633
+ o.minWidth = o.styles.cellWidth, o.wrappedWidth = o.styles.cellWidth;
634
+ else if (o.styles.cellWidth === "wrap" || i === !0)
635
+ o.contentWidth > n ? (o.minWidth = n, o.wrappedWidth = n) : (o.minWidth = o.contentWidth, o.wrappedWidth = o.contentWidth);
636
+ else {
637
+ var v = 10 / r;
638
+ o.minWidth = o.styles.minCellWidth || v, o.wrappedWidth = o.contentWidth, o.minWidth > o.wrappedWidth && (o.wrappedWidth = o.minWidth);
639
+ }
640
+ }
641
+ }
642
+ }), t.allRows().forEach(function(a) {
643
+ for (var s = 0, h = t.columns; s < h.length; s++) {
644
+ var f = h[s], o = a.cells[f.index];
645
+ if (o && o.colSpan === 1)
646
+ f.wrappedWidth = Math.max(f.wrappedWidth, o.wrappedWidth), f.minWidth = Math.max(f.minWidth, o.minWidth), f.minReadableWidth = Math.max(f.minReadableWidth, o.minReadableWidth);
647
+ else {
648
+ var l = t.styles.columnStyles[f.dataKey] || t.styles.columnStyles[f.index] || {}, g = l.cellWidth || l.minCellWidth;
649
+ g && typeof g == "number" && (f.minWidth = g, f.wrappedWidth = g);
650
+ }
651
+ o && (o.colSpan > 1 && !f.minWidth && (f.minWidth = o.minWidth), o.colSpan > 1 && !f.wrappedWidth && (f.wrappedWidth = o.minWidth));
652
+ }
653
+ });
654
+ }
655
+ function j(e, t, r) {
656
+ for (var i = t, n = e.reduce(function(v, d) {
657
+ return v + d.wrappedWidth;
658
+ }, 0), a = 0; a < e.length; a++) {
659
+ var s = e[a], h = s.wrappedWidth / n, f = i * h, o = s.width + f, l = r(s), g = o < l ? l : o;
660
+ t -= g - s.width, s.width = g;
661
+ }
662
+ if (t = Math.round(t * 1e10) / 1e10, t) {
663
+ var u = e.filter(function(v) {
664
+ return t < 0 ? v.width > r(v) : !0;
665
+ });
666
+ u.length && (t = j(u, t, r));
667
+ }
668
+ return t;
669
+ }
670
+ function Pt(e) {
671
+ for (var t = {}, r = 1, i = e.allRows(), n = 0; n < i.length; n++)
672
+ for (var a = i[n], s = 0, h = e.columns; s < h.length; s++) {
673
+ var f = h[s], o = t[f.index];
674
+ if (r > 1)
675
+ r--, delete a.cells[f.index];
676
+ else if (o)
677
+ o.cell.height += a.height, r = o.cell.colSpan, delete a.cells[f.index], o.left--, o.left <= 1 && delete t[f.index];
678
+ else {
679
+ var l = a.cells[f.index];
680
+ if (!l)
681
+ continue;
682
+ if (l.height = a.height, l.rowSpan > 1) {
683
+ var g = i.length - n, u = l.rowSpan > g ? g : l.rowSpan;
684
+ t[f.index] = { cell: l, left: u, row: a };
685
+ }
686
+ }
687
+ }
688
+ }
689
+ function Ht(e) {
690
+ for (var t = e.allRows(), r = 0; r < t.length; r++)
691
+ for (var i = t[r], n = null, a = 0, s = 0, h = 0; h < e.columns.length; h++) {
692
+ var f = e.columns[h];
693
+ if (s -= 1, s > 1 && e.columns[h + 1])
694
+ a += f.width, delete i.cells[f.index];
695
+ else if (n) {
696
+ var o = n;
697
+ delete i.cells[f.index], n = null, o.width = f.width + a;
698
+ } else {
699
+ var o = i.cells[f.index];
700
+ if (!o)
701
+ continue;
702
+ if (s = o.colSpan, a = 0, o.colSpan > 1) {
703
+ n = o, a += f.width;
704
+ continue;
705
+ }
706
+ o.width = f.width + a;
707
+ }
708
+ }
709
+ }
710
+ function Dt(e, t) {
711
+ for (var r = { count: 0, height: 0 }, i = 0, n = e.allRows(); i < n.length; i++) {
712
+ for (var a = n[i], s = 0, h = e.columns; s < h.length; s++) {
713
+ var f = h[s], o = a.cells[f.index];
714
+ if (o) {
715
+ t.applyStyles(o.styles, !0);
716
+ var l = o.width - o.padding("horizontal");
717
+ if (o.styles.overflow === "linebreak")
718
+ o.text = t.splitTextToSize(o.text, l + 1 / t.scaleFactor(), { fontSize: o.styles.fontSize });
719
+ else if (o.styles.overflow === "ellipsize")
720
+ o.text = N(o.text, l, o.styles, t, "...");
721
+ else if (o.styles.overflow === "hidden")
722
+ o.text = N(o.text, l, o.styles, t, "");
723
+ else if (typeof o.styles.overflow == "function") {
724
+ var g = o.styles.overflow(o.text, l);
725
+ typeof g == "string" ? o.text = [g] : o.text = g;
726
+ }
727
+ o.contentHeight = o.getContentHeight(t.scaleFactor(), t.getLineHeightFactor());
728
+ var u = o.contentHeight / o.rowSpan;
729
+ o.rowSpan > 1 && r.count * r.height < u * o.rowSpan ? r = { height: u, count: o.rowSpan } : r && r.count > 0 && r.height > u && (u = r.height), u > a.height && (a.height = u);
730
+ }
731
+ }
732
+ r.count--;
733
+ }
734
+ }
735
+ function N(e, t, r, i, n) {
736
+ return e.map(function(a) {
737
+ return Wt(a, t, r, i, n);
738
+ });
739
+ }
740
+ function Wt(e, t, r, i, n) {
741
+ var a = 1e4 * i.scaleFactor();
742
+ if (t = Math.ceil(t * a) / a, t >= D(e, r, i))
743
+ return e;
744
+ for (; t < D(e + n, r, i) && !(e.length <= 1); )
745
+ e = e.substring(0, e.length - 1);
746
+ return e.trim() + n;
747
+ }
748
+ function L(e, t) {
749
+ var r = new P(e), i = Ft(t, r.scaleFactor()), n = new wt(t, i);
750
+ return xt(r, n), r.applyStyles(r.userStyles), n;
751
+ }
752
+ function Ft(e, t) {
753
+ var r = e.content, i = kt(r.columns);
754
+ if (r.head.length === 0) {
755
+ var n = O(i, "head");
756
+ n && r.head.push(n);
757
+ }
758
+ if (r.foot.length === 0) {
759
+ var n = O(i, "foot");
760
+ n && r.foot.push(n);
761
+ }
762
+ var a = e.settings.theme, s = e.styles;
763
+ return {
764
+ columns: i,
765
+ head: k("head", r.head, i, s, a, t),
766
+ body: k("body", r.body, i, s, a, t),
767
+ foot: k("foot", r.foot, i, s, a, t)
768
+ };
769
+ }
770
+ function k(e, t, r, i, n, a) {
771
+ var s = {}, h = t.map(function(f, o) {
772
+ for (var l = 0, g = {}, u = 0, v = 0, d = 0, m = r; d < m.length; d++) {
773
+ var p = m[d];
774
+ if (s[p.index] == null || s[p.index].left === 0)
775
+ if (v === 0) {
776
+ var y = void 0;
777
+ Array.isArray(f) ? y = f[p.index - u - l] : y = f[p.dataKey];
778
+ var x = {};
779
+ typeof y == "object" && !Array.isArray(y) && (x = y?.styles || {});
780
+ var c = Tt(e, p, o, n, i, a, x), C = new tt(y, c, e);
781
+ g[p.dataKey] = C, g[p.index] = C, v = C.colSpan - 1, s[p.index] = {
782
+ left: C.rowSpan - 1,
783
+ times: v
784
+ };
785
+ } else
786
+ v--, u++;
787
+ else
788
+ s[p.index].left--, v = s[p.index].times, l++;
789
+ }
790
+ return new V(f, o, e, g);
791
+ });
792
+ return h;
793
+ }
794
+ function O(e, t) {
795
+ var r = {};
796
+ return e.forEach(function(i) {
797
+ if (i.raw != null) {
798
+ var n = bt(t, i.raw);
799
+ n != null && (r[i.dataKey] = n);
800
+ }
801
+ }), Object.keys(r).length > 0 ? r : null;
802
+ }
803
+ function bt(e, t) {
804
+ if (e === "head") {
805
+ if (typeof t == "object")
806
+ return t.header || null;
807
+ if (typeof t == "string" || typeof t == "number")
808
+ return t;
809
+ } else if (e === "foot" && typeof t == "object")
810
+ return t.footer;
811
+ return null;
812
+ }
813
+ function kt(e) {
814
+ return e.map(function(t, r) {
815
+ var i, n;
816
+ return typeof t == "object" ? n = (i = t.dataKey) !== null && i !== void 0 ? i : r : n = r, new St(n, t, r);
817
+ });
818
+ }
819
+ function Tt(e, t, r, i, n, a, s) {
820
+ var h = at(i), f;
821
+ e === "head" ? f = n.headStyles : e === "body" ? f = n.bodyStyles : e === "foot" && (f = n.footStyles);
822
+ var o = w({}, h.table, h[e], n.styles, f), l = n.columnStyles[t.dataKey] || n.columnStyles[t.index] || {}, g = e === "body" ? l : {}, u = e === "body" && r % 2 === 0 ? w({}, h.alternateRow, n.alternateRowStyles) : {}, v = nt(a), d = w({}, v, o, u, g);
823
+ return w(d, s);
824
+ }
825
+ function Rt(e, t, r) {
826
+ var i;
827
+ r === void 0 && (r = {});
828
+ var n = Q(e, t), a = /* @__PURE__ */ new Map(), s = [], h = [], f = [];
829
+ Array.isArray(t.settings.horizontalPageBreakRepeat) ? f = t.settings.horizontalPageBreakRepeat : (typeof t.settings.horizontalPageBreakRepeat == "string" || typeof t.settings.horizontalPageBreakRepeat == "number") && (f = [t.settings.horizontalPageBreakRepeat]), f.forEach(function(u) {
830
+ var v = t.columns.find(function(d) {
831
+ return d.dataKey === u || d.index === u;
832
+ });
833
+ v && !a.has(v.index) && (a.set(v.index, !0), s.push(v.index), h.push(t.columns[v.index]), n -= v.wrappedWidth);
834
+ });
835
+ for (var o = !0, l = (i = r?.start) !== null && i !== void 0 ? i : 0; l < t.columns.length; ) {
836
+ if (a.has(l)) {
837
+ l++;
838
+ continue;
839
+ }
840
+ var g = t.columns[l].wrappedWidth;
841
+ if (o || n >= g)
842
+ o = !1, s.push(l), h.push(t.columns[l]), n -= g;
843
+ else
844
+ break;
845
+ l++;
846
+ }
847
+ return { colIndexes: s, columns: h, lastIndex: l - 1 };
848
+ }
849
+ function zt(e, t) {
850
+ for (var r = [], i = 0; i < t.columns.length; i++) {
851
+ var n = Rt(e, t, { start: i });
852
+ n.columns.length && (r.push(n), i = n.lastIndex);
853
+ }
854
+ return r;
855
+ }
856
+ function E(e, t) {
857
+ var r = t.settings, i = r.startY, n = r.margin, a = { x: n.left, y: i }, s = t.getHeadHeight(t.columns) + t.getFootHeight(t.columns), h = i + n.bottom + s;
858
+ if (r.pageBreak === "avoid") {
859
+ var f = t.body, o = f.reduce(function(u, v) {
860
+ return u + v.height;
861
+ }, 0);
862
+ h += o;
863
+ }
864
+ var l = new P(e);
865
+ (r.pageBreak === "always" || r.startY != null && h > l.pageSize().height) && (it(l), a.y = n.top), t.callWillDrawPageHooks(l, a);
866
+ var g = w({}, a);
867
+ t.startPageNumber = l.pageNumber(), r.horizontalPageBreak ? At(l, t, g, a) : (l.applyStyles(l.userStyles), (r.showHead === "firstPage" || r.showHead === "everyPage") && t.head.forEach(function(u) {
868
+ return S(l, t, u, a, t.columns);
869
+ }), l.applyStyles(l.userStyles), t.body.forEach(function(u, v) {
870
+ var d = v === t.body.length - 1;
871
+ W(l, t, u, d, g, a, t.columns);
872
+ }), l.applyStyles(l.userStyles), (r.showFoot === "lastPage" || r.showFoot === "everyPage") && t.foot.forEach(function(u) {
873
+ return S(l, t, u, a, t.columns);
874
+ })), U(l, t, g, a), t.callEndPageHooks(l, a), t.finalY = a.y, e.lastAutoTable = t, l.applyStyles(l.userStyles);
875
+ }
876
+ function At(e, t, r, i) {
877
+ var n = zt(e, t), a = t.settings;
878
+ if (a.horizontalPageBreakBehaviour === "afterAllRows")
879
+ n.forEach(function(o, l) {
880
+ e.applyStyles(e.userStyles), l > 0 ? H(e, t, r, i, o.columns, !0) : Y(e, t, i, o.columns), jt(e, t, r, i, o.columns), T(e, t, i, o.columns);
881
+ });
882
+ else
883
+ for (var s = -1, h = n[0], f = function() {
884
+ var o = s;
885
+ if (h) {
886
+ e.applyStyles(e.userStyles);
887
+ var l = h.columns;
888
+ s >= 0 ? H(e, t, r, i, l, !0) : Y(e, t, i, l), o = I(e, t, s + 1, i, l), T(e, t, i, l);
889
+ }
890
+ var g = o - s;
891
+ n.slice(1).forEach(function(u) {
892
+ e.applyStyles(e.userStyles), H(e, t, r, i, u.columns, !0), I(e, t, s + 1, i, u.columns, g), T(e, t, i, u.columns);
893
+ }), s = o;
894
+ }; s < t.body.length - 1; )
895
+ f();
896
+ }
897
+ function Y(e, t, r, i) {
898
+ var n = t.settings;
899
+ e.applyStyles(e.userStyles), (n.showHead === "firstPage" || n.showHead === "everyPage") && t.head.forEach(function(a) {
900
+ return S(e, t, a, r, i);
901
+ });
902
+ }
903
+ function jt(e, t, r, i, n) {
904
+ e.applyStyles(e.userStyles), t.body.forEach(function(a, s) {
905
+ var h = s === t.body.length - 1;
906
+ W(e, t, a, h, r, i, n);
907
+ });
908
+ }
909
+ function I(e, t, r, i, n, a) {
910
+ e.applyStyles(e.userStyles), a = a ?? t.body.length;
911
+ var s = Math.min(r + a, t.body.length), h = -1;
912
+ return t.body.slice(r, s).forEach(function(f, o) {
913
+ var l = r + o === t.body.length - 1, g = et(e, t, l, i);
914
+ f.canEntireRowFit(g, n) && (S(e, t, f, i, n), h = r + o);
915
+ }), h;
916
+ }
917
+ function T(e, t, r, i) {
918
+ var n = t.settings;
919
+ e.applyStyles(e.userStyles), (n.showFoot === "lastPage" || n.showFoot === "everyPage") && t.foot.forEach(function(a) {
920
+ return S(e, t, a, r, i);
921
+ });
922
+ }
923
+ function Bt(e, t, r) {
924
+ var i = r.getLineHeight(e.styles.fontSize), n = e.padding("vertical"), a = Math.floor((t - n) / i);
925
+ return Math.max(0, a);
926
+ }
927
+ function Lt(e, t, r, i) {
928
+ var n = {};
929
+ e.spansMultiplePages = !0, e.height = 0;
930
+ for (var a = 0, s = 0, h = r.columns; s < h.length; s++) {
931
+ var f = h[s], o = e.cells[f.index];
932
+ if (o) {
933
+ Array.isArray(o.text) || (o.text = [o.text]);
934
+ var l = new tt(o.raw, o.styles, o.section);
935
+ l = w(l, o), l.text = [];
936
+ var g = Bt(o, t, i);
937
+ o.text.length > g && (l.text = o.text.splice(g, o.text.length));
938
+ var u = i.scaleFactor(), v = i.getLineHeightFactor();
939
+ o.contentHeight = o.getContentHeight(u, v), o.contentHeight >= t && (o.contentHeight = t, l.styles.minCellHeight -= t), o.contentHeight > e.height && (e.height = o.contentHeight), l.contentHeight = l.getContentHeight(u, v), l.contentHeight > a && (a = l.contentHeight), n[f.index] = l;
940
+ }
941
+ }
942
+ var d = new V(e.raw, -1, e.section, n, !0);
943
+ d.height = a;
944
+ for (var m = 0, p = r.columns; m < p.length; m++) {
945
+ var f = p[m], l = d.cells[f.index];
946
+ l && (l.height = d.height);
947
+ var o = e.cells[f.index];
948
+ o && (o.height = e.height);
949
+ }
950
+ return d;
951
+ }
952
+ function Et(e, t, r, i) {
953
+ var n = e.pageSize().height, a = i.settings.margin, s = a.top + a.bottom, h = n - s;
954
+ t.section === "body" && (h -= i.getHeadHeight(i.columns) + i.getFootHeight(i.columns));
955
+ var f = t.getMinimumRowHeight(i.columns, e), o = f < r;
956
+ if (f > h)
957
+ return console.log("Will not be able to print row ".concat(t.index, " correctly since it's minimum height is larger than page height")), !0;
958
+ if (!o)
959
+ return !1;
960
+ var l = t.hasRowSpan(i.columns), g = t.getMaxCellHeight(i.columns) > h;
961
+ return g ? (l && console.log("The content of row ".concat(t.index, " will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")), !0) : !(l || i.settings.rowPageBreak === "avoid");
962
+ }
963
+ function W(e, t, r, i, n, a, s) {
964
+ var h = et(e, t, i, a);
965
+ if (r.canEntireRowFit(h, s))
966
+ S(e, t, r, a, s);
967
+ else if (Et(e, r, h, t)) {
968
+ var f = Lt(r, h, t, e);
969
+ S(e, t, r, a, s), H(e, t, n, a, s), W(e, t, f, i, n, a, s);
970
+ } else
971
+ H(e, t, n, a, s), W(e, t, r, i, n, a, s);
972
+ }
973
+ function S(e, t, r, i, n) {
974
+ i.x = t.settings.margin.left;
975
+ for (var a = 0, s = n; a < s.length; a++) {
976
+ var h = s[a], f = r.cells[h.index];
977
+ if (!f) {
978
+ i.x += h.width;
979
+ continue;
980
+ }
981
+ e.applyStyles(f.styles), f.x = i.x, f.y = i.y;
982
+ var o = t.callCellHooks(e, t.hooks.willDrawCell, f, r, h, i);
983
+ if (o === !1) {
984
+ i.x += h.width;
985
+ continue;
986
+ }
987
+ Mt(e, f, i);
988
+ var l = f.getTextPos();
989
+ q(f.text, l.x, l.y, {
990
+ halign: f.styles.halign,
991
+ valign: f.styles.valign,
992
+ maxWidth: Math.ceil(f.width - f.padding("left") - f.padding("right"))
993
+ }, e.getDocument()), t.callCellHooks(e, t.hooks.didDrawCell, f, r, h, i), i.x += h.width;
994
+ }
995
+ i.y += r.height;
996
+ }
997
+ function Mt(e, t, r) {
998
+ var i = t.styles;
999
+ if (e.getDocument().setFillColor(e.getDocument().getFillColor()), typeof i.lineWidth == "number") {
1000
+ var n = $(i.lineWidth, i.fillColor);
1001
+ n && e.rect(t.x, r.y, t.width, t.height, n);
1002
+ } else typeof i.lineWidth == "object" && (i.fillColor && e.rect(t.x, r.y, t.width, t.height, "F"), Nt(e, t, r, i.lineWidth));
1003
+ }
1004
+ function Nt(e, t, r, i) {
1005
+ var n, a, s, h;
1006
+ i.top && (n = r.x, a = r.y, s = r.x + t.width, h = r.y, i.right && (s += 0.5 * i.right), i.left && (n -= 0.5 * i.left), f(i.top, n, a, s, h)), i.bottom && (n = r.x, a = r.y + t.height, s = r.x + t.width, h = r.y + t.height, i.right && (s += 0.5 * i.right), i.left && (n -= 0.5 * i.left), f(i.bottom, n, a, s, h)), i.left && (n = r.x, a = r.y, s = r.x, h = r.y + t.height, i.top && (a -= 0.5 * i.top), i.bottom && (h += 0.5 * i.bottom), f(i.left, n, a, s, h)), i.right && (n = r.x + t.width, a = r.y, s = r.x + t.width, h = r.y + t.height, i.top && (a -= 0.5 * i.top), i.bottom && (h += 0.5 * i.bottom), f(i.right, n, a, s, h));
1007
+ function f(o, l, g, u, v) {
1008
+ e.getDocument().setLineWidth(o), e.getDocument().line(l, g, u, v, "S");
1009
+ }
1010
+ }
1011
+ function et(e, t, r, i) {
1012
+ var n = t.settings.margin.bottom, a = t.settings.showFoot;
1013
+ return (a === "everyPage" || a === "lastPage" && r) && (n += t.getFootHeight(t.columns)), e.pageSize().height - i.y - n;
1014
+ }
1015
+ function H(e, t, r, i, n, a) {
1016
+ n === void 0 && (n = []), a === void 0 && (a = !1), e.applyStyles(e.userStyles), t.settings.showFoot === "everyPage" && !a && t.foot.forEach(function(h) {
1017
+ return S(e, t, h, i, n);
1018
+ }), t.callEndPageHooks(e, i);
1019
+ var s = t.settings.margin;
1020
+ U(e, t, r, i), it(e), t.pageNumber++, i.x = s.left, i.y = s.top, r.y = s.top, t.callWillDrawPageHooks(e, i), t.settings.showHead === "everyPage" && (t.head.forEach(function(h) {
1021
+ return S(e, t, h, i, n);
1022
+ }), e.applyStyles(e.userStyles));
1023
+ }
1024
+ function it(e) {
1025
+ var t = e.pageNumber();
1026
+ e.setPage(t + 1);
1027
+ var r = e.pageNumber();
1028
+ return r === t ? (e.addPage(), !0) : !1;
1029
+ }
1030
+ function Ot(e) {
1031
+ e.API.autoTable = function() {
1032
+ for (var t = [], r = 0; r < arguments.length; r++)
1033
+ t[r] = arguments[r];
1034
+ var i = t[0], n = B(this, i), a = L(this, n);
1035
+ return E(this, a), this;
1036
+ }, e.API.lastAutoTable = !1, e.API.autoTableText = function(t, r, i, n) {
1037
+ q(t, r, i, n, this);
1038
+ }, e.API.autoTableSetDefaults = function(t) {
1039
+ return P.setDefaults(t, this), this;
1040
+ }, e.autoTableSetDefaults = function(t, r) {
1041
+ P.setDefaults(t, r);
1042
+ }, e.API.autoTableHtmlToJson = function(t, r) {
1043
+ var i;
1044
+ if (r === void 0 && (r = !1), typeof window > "u")
1045
+ return console.error("Cannot run autoTableHtmlToJson in non browser environment"), null;
1046
+ var n = new P(this), a = Z(n, t, window, r, !1), s = a.head, h = a.body, f = ((i = s[0]) === null || i === void 0 ? void 0 : i.map(function(o) {
1047
+ return o.content;
1048
+ })) || [];
1049
+ return { columns: f, rows: h, data: h };
1050
+ };
1051
+ }
1052
+ var R;
1053
+ function Yt(e, t) {
1054
+ var r = B(e, t), i = L(e, r);
1055
+ E(e, i);
1056
+ }
1057
+ function It(e, t) {
1058
+ var r = B(e, t);
1059
+ return L(e, r);
1060
+ }
1061
+ function Kt(e, t) {
1062
+ E(e, t);
1063
+ }
1064
+ try {
1065
+ if (typeof window < "u" && window) {
1066
+ var K = window, _ = K.jsPDF || ((R = K.jspdf) === null || R === void 0 ? void 0 : R.jsPDF);
1067
+ _ && Ot(_);
1068
+ }
1069
+ } catch (e) {
1070
+ console.error("Could not apply autoTable plugin", e);
1071
+ }
1072
+ export {
1073
+ tt as Cell,
1074
+ ct as CellHookData,
1075
+ St as Column,
1076
+ A as HookData,
1077
+ V as Row,
1078
+ wt as Table,
1079
+ It as __createTable,
1080
+ Kt as __drawTable,
1081
+ Ot as applyPlugin,
1082
+ Yt as autoTable,
1083
+ Yt as default
1084
+ };