@ianicdev/datatables2 0.4.7 → 0.4.9

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,683 @@
1
+ var v = { exports: {} }, j;
2
+ function S() {
3
+ return j || (j = 1, function(M, O) {
4
+ (function(a, n) {
5
+ M.exports = n();
6
+ })(window, function() {
7
+ return (
8
+ /******/
9
+ function(h) {
10
+ var a = {};
11
+ function n(o) {
12
+ if (a[o])
13
+ return a[o].exports;
14
+ var s = a[o] = {
15
+ /******/
16
+ i: o,
17
+ /******/
18
+ l: !1,
19
+ /******/
20
+ exports: {}
21
+ /******/
22
+ };
23
+ return h[o].call(s.exports, s, s.exports, n), s.l = !0, s.exports;
24
+ }
25
+ return n.m = h, n.c = a, n.d = function(o, s, f) {
26
+ n.o(o, s) || Object.defineProperty(o, s, { enumerable: !0, get: f });
27
+ }, n.r = function(o) {
28
+ typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: !0 });
29
+ }, n.t = function(o, s) {
30
+ if (s & 1 && (o = n(o)), s & 8 || s & 4 && typeof o == "object" && o && o.__esModule) return o;
31
+ var f = /* @__PURE__ */ Object.create(null);
32
+ if (n.r(f), Object.defineProperty(f, "default", { enumerable: !0, value: o }), s & 2 && typeof o != "string") for (var b in o) n.d(f, b, (function(i) {
33
+ return o[i];
34
+ }).bind(null, b));
35
+ return f;
36
+ }, n.n = function(o) {
37
+ var s = o && o.__esModule ? (
38
+ /******/
39
+ function() {
40
+ return o.default;
41
+ }
42
+ ) : (
43
+ /******/
44
+ function() {
45
+ return o;
46
+ }
47
+ );
48
+ return n.d(s, "a", s), s;
49
+ }, n.o = function(o, s) {
50
+ return Object.prototype.hasOwnProperty.call(o, s);
51
+ }, n.p = "", n(n.s = 0);
52
+ }({
53
+ /***/
54
+ "./src/index.js": (
55
+ /*!**********************!*\
56
+ !*** ./src/index.js ***!
57
+ \**********************/
58
+ /*! exports provided: default */
59
+ /***/
60
+ function(h, a, n) {
61
+ n.r(a), n(
62
+ /*! ./sass/index.scss */
63
+ "./src/sass/index.scss"
64
+ );
65
+ var o = n(
66
+ /*! ./js/init */
67
+ "./src/js/init.js"
68
+ ), s = o.default.init;
69
+ typeof window < "u" && (window.printJS = s), a.default = s;
70
+ }
71
+ ),
72
+ /***/
73
+ "./src/js/browser.js": (
74
+ /*!***************************!*\
75
+ !*** ./src/js/browser.js ***!
76
+ \***************************/
77
+ /*! exports provided: default */
78
+ /***/
79
+ function(h, a, n) {
80
+ n.r(a);
81
+ var o = {
82
+ // Firefox 1.0+
83
+ isFirefox: function() {
84
+ return typeof InstallTrigger < "u";
85
+ },
86
+ // Internet Explorer 6-11
87
+ isIE: function() {
88
+ return navigator.userAgent.indexOf("MSIE") !== -1 || !!document.documentMode;
89
+ },
90
+ // Edge 20+
91
+ isEdge: function() {
92
+ return !o.isIE() && !!window.StyleMedia;
93
+ },
94
+ // Chrome 1+
95
+ isChrome: function() {
96
+ var f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window;
97
+ return !!f.chrome;
98
+ },
99
+ // At least Safari 3+: "[object HTMLElementConstructor]"
100
+ isSafari: function() {
101
+ return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0 || navigator.userAgent.toLowerCase().indexOf("safari") !== -1;
102
+ },
103
+ // IOS Chrome
104
+ isIOSChrome: function() {
105
+ return navigator.userAgent.toLowerCase().indexOf("crios") !== -1;
106
+ }
107
+ };
108
+ a.default = o;
109
+ }
110
+ ),
111
+ /***/
112
+ "./src/js/functions.js": (
113
+ /*!*****************************!*\
114
+ !*** ./src/js/functions.js ***!
115
+ \*****************************/
116
+ /*! exports provided: addWrapper, capitalizePrint, collectStyles, addHeader, cleanUp, isRawHTML */
117
+ /***/
118
+ function(h, a, n) {
119
+ n.r(a), n.d(a, "addWrapper", function() {
120
+ return b;
121
+ }), n.d(a, "capitalizePrint", function() {
122
+ return i;
123
+ }), n.d(a, "collectStyles", function() {
124
+ return l;
125
+ }), n.d(a, "addHeader", function() {
126
+ return e;
127
+ }), n.d(a, "cleanUp", function() {
128
+ return u;
129
+ }), n.d(a, "isRawHTML", function() {
130
+ return y;
131
+ });
132
+ var o = n(
133
+ /*! ./modal */
134
+ "./src/js/modal.js"
135
+ ), s = n(
136
+ /*! ./browser */
137
+ "./src/js/browser.js"
138
+ );
139
+ function f(t) {
140
+ "@babel/helpers - typeof";
141
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? f = function(c) {
142
+ return typeof c;
143
+ } : f = function(c) {
144
+ return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
145
+ }, f(t);
146
+ }
147
+ function b(t, d) {
148
+ var c = "font-family:" + d.font + " !important; font-size: " + d.font_size + " !important; width:100%;";
149
+ return '<div style="' + c + '">' + t + "</div>";
150
+ }
151
+ function i(t) {
152
+ return t.charAt(0).toUpperCase() + t.slice(1);
153
+ }
154
+ function l(t, d) {
155
+ for (var c = document.defaultView || window, E = "", p = c.getComputedStyle(t, ""), m = 0; m < p.length; m++)
156
+ (d.targetStyles.indexOf("*") !== -1 || d.targetStyle.indexOf(p[m]) !== -1 || r(d.targetStyles, p[m])) && p.getPropertyValue(p[m]) && (E += p[m] + ":" + p.getPropertyValue(p[m]) + ";");
157
+ return E += "max-width: " + d.maxWidth + "px !important; font-size: " + d.font_size + " !important;", E;
158
+ }
159
+ function r(t, d) {
160
+ for (var c = 0; c < t.length; c++)
161
+ if (f(d) === "object" && d.indexOf(t[c]) !== -1) return !0;
162
+ return !1;
163
+ }
164
+ function e(t, d) {
165
+ var c = document.createElement("div");
166
+ if (y(d.header))
167
+ c.innerHTML = d.header;
168
+ else {
169
+ var E = document.createElement("h1"), p = document.createTextNode(d.header);
170
+ E.appendChild(p), E.setAttribute("style", d.headerStyle), c.appendChild(E);
171
+ }
172
+ t.insertBefore(c, t.childNodes[0]);
173
+ }
174
+ function u(t) {
175
+ t.showModal && o.default.close(), t.onLoadingEnd && t.onLoadingEnd(), (t.showModal || t.onLoadingStart) && window.URL.revokeObjectURL(t.printable);
176
+ var d = "mouseover";
177
+ (s.default.isChrome() || s.default.isFirefox()) && (d = "focus");
178
+ var c = function E() {
179
+ window.removeEventListener(d, E), t.onPrintDialogClose();
180
+ var p = document.getElementById(t.frameId);
181
+ p && p.remove();
182
+ };
183
+ window.addEventListener(d, c);
184
+ }
185
+ function y(t) {
186
+ var d = new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>");
187
+ return d.test(t);
188
+ }
189
+ }
190
+ ),
191
+ /***/
192
+ "./src/js/html.js": (
193
+ /*!************************!*\
194
+ !*** ./src/js/html.js ***!
195
+ \************************/
196
+ /*! exports provided: default */
197
+ /***/
198
+ function(h, a, n) {
199
+ n.r(a);
200
+ var o = n(
201
+ /*! ./functions */
202
+ "./src/js/functions.js"
203
+ ), s = n(
204
+ /*! ./print */
205
+ "./src/js/print.js"
206
+ );
207
+ function f(l) {
208
+ "@babel/helpers - typeof";
209
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? f = function(e) {
210
+ return typeof e;
211
+ } : f = function(e) {
212
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
213
+ }, f(l);
214
+ }
215
+ a.default = {
216
+ print: function(r, e) {
217
+ var u = i(r.printable) ? r.printable : document.getElementById(r.printable);
218
+ if (!u) {
219
+ window.console.error("Invalid HTML element id: " + r.printable);
220
+ return;
221
+ }
222
+ r.printableElement = b(u, r), r.header && Object(o.addHeader)(r.printableElement, r), s.default.send(r, e);
223
+ }
224
+ };
225
+ function b(l, r) {
226
+ for (var e = l.cloneNode(), u = Array.prototype.slice.call(l.childNodes), y = 0; y < u.length; y++)
227
+ if (r.ignoreElements.indexOf(u[y].id) === -1) {
228
+ var t = b(u[y], r);
229
+ e.appendChild(t);
230
+ }
231
+ switch (r.scanStyles && l.nodeType === 1 && e.setAttribute("style", Object(o.collectStyles)(l, r)), l.tagName) {
232
+ case "SELECT":
233
+ e.value = l.value;
234
+ break;
235
+ case "CANVAS":
236
+ e.getContext("2d").drawImage(l, 0, 0);
237
+ break;
238
+ }
239
+ return e;
240
+ }
241
+ function i(l) {
242
+ return f(l) === "object" && l && (l instanceof HTMLElement || l.nodeType === 1);
243
+ }
244
+ }
245
+ ),
246
+ /***/
247
+ "./src/js/image.js": (
248
+ /*!*************************!*\
249
+ !*** ./src/js/image.js ***!
250
+ \*************************/
251
+ /*! exports provided: default */
252
+ /***/
253
+ function(h, a, n) {
254
+ n.r(a);
255
+ var o = n(
256
+ /*! ./functions */
257
+ "./src/js/functions.js"
258
+ ), s = n(
259
+ /*! ./print */
260
+ "./src/js/print.js"
261
+ ), f = n(
262
+ /*! ./browser */
263
+ "./src/js/browser.js"
264
+ );
265
+ a.default = {
266
+ print: function(i, l) {
267
+ i.printable.constructor !== Array && (i.printable = [i.printable]), i.printableElement = document.createElement("div"), i.printable.forEach(function(r) {
268
+ var e = document.createElement("img");
269
+ if (e.setAttribute("style", i.imageStyle), e.src = r, f.default.isFirefox()) {
270
+ var u = e.src;
271
+ e.src = u;
272
+ }
273
+ var y = document.createElement("div");
274
+ y.appendChild(e), i.printableElement.appendChild(y);
275
+ }), i.header && Object(o.addHeader)(i.printableElement, i), s.default.send(i, l);
276
+ }
277
+ };
278
+ }
279
+ ),
280
+ /***/
281
+ "./src/js/init.js": (
282
+ /*!************************!*\
283
+ !*** ./src/js/init.js ***!
284
+ \************************/
285
+ /*! exports provided: default */
286
+ /***/
287
+ function(h, a, n) {
288
+ n.r(a);
289
+ var o = n(
290
+ /*! ./browser */
291
+ "./src/js/browser.js"
292
+ ), s = n(
293
+ /*! ./modal */
294
+ "./src/js/modal.js"
295
+ ), f = n(
296
+ /*! ./pdf */
297
+ "./src/js/pdf.js"
298
+ ), b = n(
299
+ /*! ./html */
300
+ "./src/js/html.js"
301
+ ), i = n(
302
+ /*! ./raw-html */
303
+ "./src/js/raw-html.js"
304
+ ), l = n(
305
+ /*! ./image */
306
+ "./src/js/image.js"
307
+ ), r = n(
308
+ /*! ./json */
309
+ "./src/js/json.js"
310
+ );
311
+ function e(y) {
312
+ "@babel/helpers - typeof";
313
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? e = function(d) {
314
+ return typeof d;
315
+ } : e = function(d) {
316
+ return d && typeof Symbol == "function" && d.constructor === Symbol && d !== Symbol.prototype ? "symbol" : typeof d;
317
+ }, e(y);
318
+ }
319
+ var u = ["pdf", "html", "image", "json", "raw-html"];
320
+ a.default = {
321
+ init: function() {
322
+ var t = {
323
+ printable: null,
324
+ fallbackPrintable: null,
325
+ type: "pdf",
326
+ header: null,
327
+ headerStyle: "font-weight: 300;",
328
+ maxWidth: 800,
329
+ properties: null,
330
+ gridHeaderStyle: "font-weight: bold; padding: 5px; border: 1px solid #dddddd;",
331
+ gridStyle: "border: 1px solid lightgray; margin-bottom: -1px;",
332
+ showModal: !1,
333
+ onError: function(P) {
334
+ throw P;
335
+ },
336
+ onLoadingStart: null,
337
+ onLoadingEnd: null,
338
+ onPrintDialogClose: function() {
339
+ },
340
+ onIncompatibleBrowser: function() {
341
+ },
342
+ modalMessage: "Retrieving Document...",
343
+ frameId: "printJS",
344
+ printableElement: null,
345
+ documentTitle: "Document",
346
+ targetStyle: ["clear", "display", "width", "min-width", "height", "min-height", "max-height"],
347
+ targetStyles: ["border", "box", "break", "text-decoration"],
348
+ ignoreElements: [],
349
+ repeatTableHeader: !0,
350
+ css: null,
351
+ style: null,
352
+ scanStyles: !0,
353
+ base64: !1,
354
+ // Deprecated
355
+ onPdfOpen: null,
356
+ font: "TimesNewRoman",
357
+ font_size: "12pt",
358
+ honorMarginPadding: !0,
359
+ honorColor: !1,
360
+ imageStyle: "max-width: 100%;"
361
+ }, d = arguments[0];
362
+ if (d === void 0)
363
+ throw new Error("printJS expects at least 1 attribute.");
364
+ switch (e(d)) {
365
+ case "string":
366
+ t.printable = encodeURI(d), t.fallbackPrintable = t.printable, t.type = arguments[1] || t.type;
367
+ break;
368
+ case "object":
369
+ t.printable = d.printable, t.fallbackPrintable = typeof d.fallbackPrintable < "u" ? d.fallbackPrintable : t.printable, t.fallbackPrintable = t.base64 ? "data:application/pdf;base64,".concat(t.fallbackPrintable) : t.fallbackPrintable;
370
+ for (var c in t)
371
+ c === "printable" || c === "fallbackPrintable" || (t[c] = typeof d[c] < "u" ? d[c] : t[c]);
372
+ break;
373
+ default:
374
+ throw new Error('Unexpected argument type! Expected "string" or "object", got ' + e(d));
375
+ }
376
+ if (!t.printable) throw new Error("Missing printable information.");
377
+ if (!t.type || typeof t.type != "string" || u.indexOf(t.type.toLowerCase()) === -1)
378
+ throw new Error("Invalid print type. Available types are: pdf, html, image and json.");
379
+ t.showModal && s.default.show(t), t.onLoadingStart && t.onLoadingStart();
380
+ var E = document.getElementById(t.frameId);
381
+ E && E.parentNode.removeChild(E);
382
+ var p = document.createElement("iframe");
383
+ switch (o.default.isFirefox() ? p.setAttribute("style", "width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0") : p.setAttribute("style", "visibility: hidden; height: 0; width: 0; position: absolute; border: 0"), p.setAttribute("id", t.frameId), t.type !== "pdf" && (p.srcdoc = "<html><head><title>" + t.documentTitle + "</title>", t.css && (Array.isArray(t.css) || (t.css = [t.css]), t.css.forEach(function(g) {
384
+ p.srcdoc += '<link rel="stylesheet" href="' + g + '">';
385
+ })), p.srcdoc += "</head><body></body></html>"), t.type) {
386
+ case "pdf":
387
+ if (o.default.isIE())
388
+ try {
389
+ console.info("Print.js doesn't support PDF printing in Internet Explorer.");
390
+ var m = window.open(t.fallbackPrintable, "_blank");
391
+ m.focus(), t.onIncompatibleBrowser();
392
+ } catch (g) {
393
+ t.onError(g);
394
+ } finally {
395
+ t.showModal && s.default.close(), t.onLoadingEnd && t.onLoadingEnd();
396
+ }
397
+ else
398
+ f.default.print(t, p);
399
+ break;
400
+ case "image":
401
+ l.default.print(t, p);
402
+ break;
403
+ case "html":
404
+ b.default.print(t, p);
405
+ break;
406
+ case "raw-html":
407
+ i.default.print(t, p);
408
+ break;
409
+ case "json":
410
+ r.default.print(t, p);
411
+ break;
412
+ }
413
+ }
414
+ };
415
+ }
416
+ ),
417
+ /***/
418
+ "./src/js/json.js": (
419
+ /*!************************!*\
420
+ !*** ./src/js/json.js ***!
421
+ \************************/
422
+ /*! exports provided: default */
423
+ /***/
424
+ function(h, a, n) {
425
+ n.r(a);
426
+ var o = n(
427
+ /*! ./functions */
428
+ "./src/js/functions.js"
429
+ ), s = n(
430
+ /*! ./print */
431
+ "./src/js/print.js"
432
+ );
433
+ function f(i) {
434
+ "@babel/helpers - typeof";
435
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? f = function(r) {
436
+ return typeof r;
437
+ } : f = function(r) {
438
+ return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
439
+ }, f(i);
440
+ }
441
+ a.default = {
442
+ print: function(l, r) {
443
+ if (f(l.printable) !== "object")
444
+ throw new Error("Invalid javascript data object (JSON).");
445
+ if (typeof l.repeatTableHeader != "boolean")
446
+ throw new Error("Invalid value for repeatTableHeader attribute (JSON).");
447
+ if (!l.properties || !Array.isArray(l.properties))
448
+ throw new Error("Invalid properties array for your JSON data.");
449
+ l.properties = l.properties.map(function(e) {
450
+ return {
451
+ field: f(e) === "object" ? e.field : e,
452
+ displayName: f(e) === "object" ? e.displayName : e,
453
+ columnSize: f(e) === "object" && e.columnSize ? e.columnSize + ";" : 100 / l.properties.length + "%;"
454
+ };
455
+ }), l.printableElement = document.createElement("div"), l.header && Object(o.addHeader)(l.printableElement, l), l.printableElement.innerHTML += b(l), s.default.send(l, r);
456
+ }
457
+ };
458
+ function b(i) {
459
+ var l = i.printable, r = i.properties, e = '<table style="border-collapse: collapse; width: 100%;">';
460
+ i.repeatTableHeader && (e += "<thead>"), e += "<tr>";
461
+ for (var u = 0; u < r.length; u++)
462
+ e += '<th style="width:' + r[u].columnSize + ";" + i.gridHeaderStyle + '">' + Object(o.capitalizePrint)(r[u].displayName) + "</th>";
463
+ e += "</tr>", i.repeatTableHeader && (e += "</thead>"), e += "<tbody>";
464
+ for (var y = 0; y < l.length; y++) {
465
+ e += "<tr>";
466
+ for (var t = 0; t < r.length; t++) {
467
+ var d = l[y], c = r[t].field.split(".");
468
+ if (c.length > 1)
469
+ for (var E = 0; E < c.length; E++)
470
+ d = d[c[E]];
471
+ else
472
+ d = d[r[t].field];
473
+ e += '<td style="width:' + r[t].columnSize + i.gridStyle + '">' + d + "</td>";
474
+ }
475
+ e += "</tr>";
476
+ }
477
+ return e += "</tbody></table>", e;
478
+ }
479
+ }
480
+ ),
481
+ /***/
482
+ "./src/js/modal.js": (
483
+ /*!*************************!*\
484
+ !*** ./src/js/modal.js ***!
485
+ \*************************/
486
+ /*! exports provided: default */
487
+ /***/
488
+ function(h, a, n) {
489
+ n.r(a);
490
+ var o = {
491
+ show: function(f) {
492
+ var b = "font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;", i = document.createElement("div");
493
+ i.setAttribute("style", b), i.setAttribute("id", "printJS-Modal");
494
+ var l = document.createElement("div");
495
+ l.setAttribute("style", "display:table-cell; vertical-align:middle; padding-bottom:100px;");
496
+ var r = document.createElement("div");
497
+ r.setAttribute("class", "printClose"), r.setAttribute("id", "printClose"), l.appendChild(r);
498
+ var e = document.createElement("span");
499
+ e.setAttribute("class", "printSpinner"), l.appendChild(e);
500
+ var u = document.createTextNode(f.modalMessage);
501
+ l.appendChild(u), i.appendChild(l), document.getElementsByTagName("body")[0].appendChild(i), document.getElementById("printClose").addEventListener("click", function() {
502
+ o.close();
503
+ });
504
+ },
505
+ close: function() {
506
+ var f = document.getElementById("printJS-Modal");
507
+ f && f.parentNode.removeChild(f);
508
+ }
509
+ };
510
+ a.default = o;
511
+ }
512
+ ),
513
+ /***/
514
+ "./src/js/pdf.js": (
515
+ /*!***********************!*\
516
+ !*** ./src/js/pdf.js ***!
517
+ \***********************/
518
+ /*! exports provided: default */
519
+ /***/
520
+ function(h, a, n) {
521
+ n.r(a);
522
+ var o = n(
523
+ /*! ./print */
524
+ "./src/js/print.js"
525
+ ), s = n(
526
+ /*! ./functions */
527
+ "./src/js/functions.js"
528
+ );
529
+ a.default = {
530
+ print: function(i, l) {
531
+ if (i.base64) {
532
+ var r = Uint8Array.from(atob(i.printable), function(u) {
533
+ return u.charCodeAt(0);
534
+ });
535
+ f(i, l, r);
536
+ return;
537
+ }
538
+ i.printable = /^(blob|http|\/\/)/i.test(i.printable) ? i.printable : window.location.origin + (i.printable.charAt(0) !== "/" ? "/" + i.printable : i.printable);
539
+ var e = new window.XMLHttpRequest();
540
+ e.responseType = "arraybuffer", e.addEventListener("error", function() {
541
+ Object(s.cleanUp)(i), i.onError(e.statusText, e);
542
+ }), e.addEventListener("load", function() {
543
+ if ([200, 201].indexOf(e.status) === -1) {
544
+ Object(s.cleanUp)(i), i.onError(e.statusText, e);
545
+ return;
546
+ }
547
+ f(i, l, e.response);
548
+ }), e.open("GET", i.printable, !0), e.send();
549
+ }
550
+ };
551
+ function f(b, i, l) {
552
+ var r = new window.Blob([l], {
553
+ type: "application/pdf"
554
+ });
555
+ r = window.URL.createObjectURL(r), i.setAttribute("src", r), o.default.send(b, i);
556
+ }
557
+ }
558
+ ),
559
+ /***/
560
+ "./src/js/print.js": (
561
+ /*!*************************!*\
562
+ !*** ./src/js/print.js ***!
563
+ \*************************/
564
+ /*! exports provided: default */
565
+ /***/
566
+ function(h, a, n) {
567
+ n.r(a);
568
+ var o = n(
569
+ /*! ./browser */
570
+ "./src/js/browser.js"
571
+ ), s = n(
572
+ /*! ./functions */
573
+ "./src/js/functions.js"
574
+ ), f = {
575
+ send: function(e, u) {
576
+ document.getElementsByTagName("body")[0].appendChild(u);
577
+ var y = document.getElementById(e.frameId);
578
+ y.onload = function() {
579
+ if (e.type === "pdf") {
580
+ o.default.isFirefox() ? setTimeout(function() {
581
+ return b(y, e);
582
+ }, 1e3) : b(y, e);
583
+ return;
584
+ }
585
+ var t = y.contentWindow || y.contentDocument;
586
+ if (t.document && (t = t.document), t.body.appendChild(e.printableElement), e.type !== "pdf" && e.style) {
587
+ var d = document.createElement("style");
588
+ d.innerHTML = e.style, t.head.appendChild(d);
589
+ }
590
+ var c = t.getElementsByTagName("img");
591
+ c.length > 0 ? i(Array.from(c)).then(function() {
592
+ return b(y, e);
593
+ }) : b(y, e);
594
+ };
595
+ }
596
+ };
597
+ function b(r, e) {
598
+ try {
599
+ if (r.focus(), o.default.isEdge() || o.default.isIE())
600
+ try {
601
+ r.contentWindow.document.execCommand("print", !1, null);
602
+ } catch {
603
+ r.contentWindow.print();
604
+ }
605
+ else
606
+ r.contentWindow.print();
607
+ } catch (u) {
608
+ e.onError(u);
609
+ } finally {
610
+ o.default.isFirefox() && (r.style.visibility = "hidden", r.style.left = "-1px"), Object(s.cleanUp)(e);
611
+ }
612
+ }
613
+ function i(r) {
614
+ var e = r.map(function(u) {
615
+ if (u.src && u.src !== window.location.href)
616
+ return l(u);
617
+ });
618
+ return Promise.all(e);
619
+ }
620
+ function l(r) {
621
+ return new Promise(function(e) {
622
+ var u = function y() {
623
+ !r || typeof r.naturalWidth > "u" || r.naturalWidth === 0 || !r.complete ? setTimeout(y, 500) : e();
624
+ };
625
+ u();
626
+ });
627
+ }
628
+ a.default = f;
629
+ }
630
+ ),
631
+ /***/
632
+ "./src/js/raw-html.js": (
633
+ /*!****************************!*\
634
+ !*** ./src/js/raw-html.js ***!
635
+ \****************************/
636
+ /*! exports provided: default */
637
+ /***/
638
+ function(h, a, n) {
639
+ n.r(a);
640
+ var o = n(
641
+ /*! ./print */
642
+ "./src/js/print.js"
643
+ );
644
+ a.default = {
645
+ print: function(f, b) {
646
+ f.printableElement = document.createElement("div"), f.printableElement.setAttribute("style", "width:100%"), f.printableElement.innerHTML = f.printable, o.default.send(f, b);
647
+ }
648
+ };
649
+ }
650
+ ),
651
+ /***/
652
+ "./src/sass/index.scss": (
653
+ /*!*****************************!*\
654
+ !*** ./src/sass/index.scss ***!
655
+ \*****************************/
656
+ /*! no static exports found */
657
+ /***/
658
+ function(h, a, n) {
659
+ }
660
+ ),
661
+ /***/
662
+ 0: (
663
+ /*!****************************!*\
664
+ !*** multi ./src/index.js ***!
665
+ \****************************/
666
+ /*! no static exports found */
667
+ /***/
668
+ function(h, a, n) {
669
+ h.exports = n(
670
+ /*! ./src/index.js */
671
+ "./src/index.js"
672
+ );
673
+ }
674
+ )
675
+ /******/
676
+ }).default
677
+ );
678
+ });
679
+ }(v)), v.exports;
680
+ }
681
+ export {
682
+ S as r
683
+ };