\n\n\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DocumentEmail.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DocumentEmail.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./DocumentEmail.vue?vue&type=template&id=faa95c90&scoped=true&\"\nimport script from \"./DocumentEmail.vue?vue&type=script&lang=js&\"\nexport * from \"./DocumentEmail.vue?vue&type=script&lang=js&\"\nimport style0 from \"./DocumentEmail.vue?vue&type=style&index=0&id=faa95c90&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"faa95c90\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DocumentEmail.vue?vue&type=style&index=0&id=faa95c90&prod&lang=scss&scoped=true&\"","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"printJS\"] = factory();\n\telse\n\t\troot[\"printJS\"] = factory();\n})(window, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n !*** ./src/index.js ***!\n \\**********************/\n/*! exports provided: default */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sass_index_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sass/index.scss */ \"./src/sass/index.scss\");\n/* harmony import */ var _sass_index_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_sass_index_scss__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _js_init__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./js/init */ \"./src/js/init.js\");\n\n\nvar printJS = _js_init__WEBPACK_IMPORTED_MODULE_1__[\"default\"].init;\n\nif (typeof window !== 'undefined') {\n window.printJS = printJS;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (printJS);\n\n/***/ }),\n\n/***/ \"./src/js/browser.js\":\n/*!***************************!*\\\n !*** ./src/js/browser.js ***!\n \\***************************/\n/*! exports provided: default */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\nvar Browser = {\n // Firefox 1.0+\n isFirefox: function isFirefox() {\n return typeof InstallTrigger !== 'undefined';\n },\n // Internet Explorer 6-11\n isIE: function isIE() {\n return navigator.userAgent.indexOf('MSIE') !== -1 || !!document.documentMode;\n },\n // Edge 20+\n isEdge: function isEdge() {\n return !Browser.isIE() && !!window.StyleMedia;\n },\n // Chrome 1+\n isChrome: function isChrome() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;\n return !!context.chrome;\n },\n // At least Safari 3+: \"[object HTMLElementConstructor]\"\n isSafari: function isSafari() {\n return Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0 || navigator.userAgent.toLowerCase().indexOf('safari') !== -1;\n },\n // IOS Chrome\n isIOSChrome: function isIOSChrome() {\n return navigator.userAgent.toLowerCase().indexOf('crios') !== -1;\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Browser);\n\n/***/ }),\n\n/***/ \"./src/js/functions.js\":\n/*!*****************************!*\\\n !*** ./src/js/functions.js ***!\n \\*****************************/\n/*! exports provided: addWrapper, capitalizePrint, collectStyles, addHeader, cleanUp, isRawHTML */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addWrapper\", function() { return addWrapper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"capitalizePrint\", function() { return capitalizePrint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"collectStyles\", function() { return collectStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addHeader\", function() { return addHeader; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cleanUp\", function() { return cleanUp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isRawHTML\", function() { return isRawHTML; });\n/* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modal */ \"./src/js/modal.js\");\n/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./browser */ \"./src/js/browser.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\nfunction addWrapper(htmlData, params) {\n var bodyStyle = 'font-family:' + params.font + ' !important; font-size: ' + params.font_size + ' !important; width:100%;';\n return '
' + htmlData + '
';\n}\nfunction capitalizePrint(obj) {\n return obj.charAt(0).toUpperCase() + obj.slice(1);\n}\nfunction collectStyles(element, params) {\n var win = document.defaultView || window; // String variable to hold styling for each element\n\n var elementStyle = ''; // Loop over computed styles\n\n var styles = win.getComputedStyle(element, '');\n\n for (var key = 0; key < styles.length; key++) {\n // Check if style should be processed\n if (params.targetStyles.indexOf('*') !== -1 || params.targetStyle.indexOf(styles[key]) !== -1 || targetStylesMatch(params.targetStyles, styles[key])) {\n if (styles.getPropertyValue(styles[key])) elementStyle += styles[key] + ':' + styles.getPropertyValue(styles[key]) + ';';\n }\n } // Print friendly defaults (deprecated)\n\n\n elementStyle += 'max-width: ' + params.maxWidth + 'px !important; font-size: ' + params.font_size + ' !important;';\n return elementStyle;\n}\n\nfunction targetStylesMatch(styles, value) {\n for (var i = 0; i < styles.length; i++) {\n if (_typeof(value) === 'object' && value.indexOf(styles[i]) !== -1) return true;\n }\n\n return false;\n}\n\nfunction addHeader(printElement, params) {\n // Create the header container div\n var headerContainer = document.createElement('div'); // Check if the header is text or raw html\n\n if (isRawHTML(params.header)) {\n headerContainer.innerHTML = params.header;\n } else {\n // Create header element\n var headerElement = document.createElement('h1'); // Create header text node\n\n var headerNode = document.createTextNode(params.header); // Build and style\n\n headerElement.appendChild(headerNode);\n headerElement.setAttribute('style', params.headerStyle);\n headerContainer.appendChild(headerElement);\n }\n\n printElement.insertBefore(headerContainer, printElement.childNodes[0]);\n}\nfunction cleanUp(params) {\n // If we are showing a feedback message to user, remove it\n if (params.showModal) _modal__WEBPACK_IMPORTED_MODULE_0__[\"default\"].close(); // Check for a finished loading hook function\n\n if (params.onLoadingEnd) params.onLoadingEnd(); // If preloading pdf files, clean blob url\n\n if (params.showModal || params.onLoadingStart) window.URL.revokeObjectURL(params.printable); // Run onPrintDialogClose callback\n\n var event = 'mouseover';\n\n if (_browser__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isChrome() || _browser__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isFirefox()) {\n // Ps.: Firefox will require an extra click in the document to fire the focus event.\n event = 'focus';\n }\n\n var handler = function handler() {\n // Make sure the event only happens once.\n window.removeEventListener(event, handler);\n params.onPrintDialogClose(); // Remove iframe from the DOM\n\n var iframe = document.getElementById(params.frameId);\n\n if (iframe) {\n iframe.remove();\n }\n };\n\n window.addEventListener(event, handler);\n}\nfunction isRawHTML(raw) {\n var regexHtml = new RegExp('<([A-Za-z][A-Za-z0-9]*)\\\\b[^>]*>(.*?)\\\\1>');\n return regexHtml.test(raw);\n}\n\n/***/ }),\n\n/***/ \"./src/js/html.js\":\n/*!************************!*\\\n !*** ./src/js/html.js ***!\n \\************************/\n/*! exports provided: default */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./functions */ \"./src/js/functions.js\");\n/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./print */ \"./src/js/print.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n print: function print(params, printFrame) {\n // Get the DOM printable element\n var printElement = isHtmlElement(params.printable) ? params.printable : document.getElementById(params.printable); // Check if the element exists\n\n if (!printElement) {\n window.console.error('Invalid HTML element id: ' + params.printable);\n return;\n } // Clone the target element including its children (if available)\n\n\n params.printableElement = cloneElement(printElement, params); // Add header\n\n if (params.header) {\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"addHeader\"])(params.printableElement, params);\n } // Print html element contents\n\n\n _print__WEBPACK_IMPORTED_MODULE_1__[\"default\"].send(params, printFrame);\n }\n});\n\nfunction cloneElement(element, params) {\n // Clone the main node (if not already inside the recursion process)\n var clone = element.cloneNode(); // Loop over and process the children elements / nodes (including text nodes)\n\n var childNodesArray = Array.prototype.slice.call(element.childNodes);\n\n for (var i = 0; i < childNodesArray.length; i++) {\n // Check if we are skipping the current element\n if (params.ignoreElements.indexOf(childNodesArray[i].id) !== -1) {\n continue;\n } // Clone the child element\n\n\n var clonedChild = cloneElement(childNodesArray[i], params); // Attach the cloned child to the cloned parent node\n\n clone.appendChild(clonedChild);\n } // Get all styling for print element (for nodes of type element only)\n\n\n if (params.scanStyles && element.nodeType === 1) {\n clone.setAttribute('style', Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"collectStyles\"])(element, params));\n } // Check if the element needs any state processing (copy user input data)\n\n\n switch (element.tagName) {\n case 'SELECT':\n // Copy the current selection value to its clone\n clone.value = element.value;\n break;\n\n case 'CANVAS':\n // Copy the canvas content to its clone\n clone.getContext('2d').drawImage(element, 0, 0);\n break;\n }\n\n return clone;\n}\n\nfunction isHtmlElement(printable) {\n // Check if element is instance of HTMLElement or has nodeType === 1 (for elements in iframe)\n return _typeof(printable) === 'object' && printable && (printable instanceof HTMLElement || printable.nodeType === 1);\n}\n\n/***/ }),\n\n/***/ \"./src/js/image.js\":\n/*!*************************!*\\\n !*** ./src/js/image.js ***!\n \\*************************/\n/*! exports provided: default */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./functions */ \"./src/js/functions.js\");\n/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./print */ \"./src/js/print.js\");\n/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./browser */ \"./src/js/browser.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n print: function print(params, printFrame) {\n // Check if we are printing one image or multiple images\n if (params.printable.constructor !== Array) {\n // Create array with one image\n params.printable = [params.printable];\n } // Create printable element (container)\n\n\n params.printableElement = document.createElement('div'); // Create all image elements and append them to the printable container\n\n params.printable.forEach(function (src) {\n // Create the image element\n var img = document.createElement('img');\n img.setAttribute('style', params.imageStyle); // Set image src with the file url\n\n img.src = src; // The following block is for Firefox, which for some reason requires the image's src to be fully qualified in\n // order to print it\n\n if (_browser__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isFirefox()) {\n var fullyQualifiedSrc = img.src;\n img.src = fullyQualifiedSrc;\n } // Create the image wrapper\n\n\n var imageWrapper = document.createElement('div'); // Append image to the wrapper element\n\n imageWrapper.appendChild(img); // Append wrapper to the printable element\n\n params.printableElement.appendChild(imageWrapper);\n }); // Check if we are adding a print header\n\n if (params.header) Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"addHeader\"])(params.printableElement, params); // Print image\n\n _print__WEBPACK_IMPORTED_MODULE_1__[\"default\"].send(params, printFrame);\n }\n});\n\n/***/ }),\n\n/***/ \"./src/js/init.js\":\n/*!************************!*\\\n !*** ./src/js/init.js ***!\n \\************************/\n/*! exports provided: default */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser */ \"./src/js/browser.js\");\n/* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modal */ \"./src/js/modal.js\");\n/* harmony import */ var _pdf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pdf */ \"./src/js/pdf.js\");\n/* harmony import */ var _html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./html */ \"./src/js/html.js\");\n/* harmony import */ var _raw_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./raw-html */ \"./src/js/raw-html.js\");\n/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./image */ \"./src/js/image.js\");\n/* harmony import */ var _json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./json */ \"./src/js/json.js\");\n\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n\n\n\n\n\nvar printTypes = ['pdf', 'html', 'image', 'json', 'raw-html'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: function init() {\n var params = {\n printable: null,\n fallbackPrintable: null,\n type: 'pdf',\n header: null,\n headerStyle: 'font-weight: 300;',\n maxWidth: 800,\n properties: null,\n gridHeaderStyle: 'font-weight: bold; padding: 5px; border: 1px solid #dddddd;',\n gridStyle: 'border: 1px solid lightgray; margin-bottom: -1px;',\n showModal: false,\n onError: function onError(error) {\n throw error;\n },\n onLoadingStart: null,\n onLoadingEnd: null,\n onPrintDialogClose: function onPrintDialogClose() {},\n onIncompatibleBrowser: function onIncompatibleBrowser() {},\n modalMessage: 'Retrieving Document...',\n frameId: 'printJS',\n printableElement: null,\n documentTitle: 'Document',\n targetStyle: ['clear', 'display', 'width', 'min-width', 'height', 'min-height', 'max-height'],\n targetStyles: ['border', 'box', 'break', 'text-decoration'],\n ignoreElements: [],\n repeatTableHeader: true,\n css: null,\n style: null,\n scanStyles: true,\n base64: false,\n // Deprecated\n onPdfOpen: null,\n font: 'TimesNewRoman',\n font_size: '12pt',\n honorMarginPadding: true,\n honorColor: false,\n imageStyle: 'max-width: 100%;'\n }; // Check if a printable document or object was supplied\n\n var args = arguments[0];\n\n if (args === undefined) {\n throw new Error('printJS expects at least 1 attribute.');\n } // Process parameters\n\n\n switch (_typeof(args)) {\n case 'string':\n params.printable = encodeURI(args);\n params.fallbackPrintable = params.printable;\n params.type = arguments[1] || params.type;\n break;\n\n case 'object':\n params.printable = args.printable;\n params.fallbackPrintable = typeof args.fallbackPrintable !== 'undefined' ? args.fallbackPrintable : params.printable;\n params.fallbackPrintable = params.base64 ? \"data:application/pdf;base64,\".concat(params.fallbackPrintable) : params.fallbackPrintable;\n\n for (var k in params) {\n if (k === 'printable' || k === 'fallbackPrintable') continue;\n params[k] = typeof args[k] !== 'undefined' ? args[k] : params[k];\n }\n\n break;\n\n default:\n throw new Error('Unexpected argument type! Expected \"string\" or \"object\", got ' + _typeof(args));\n } // Validate printable\n\n\n if (!params.printable) throw new Error('Missing printable information.'); // Validate type\n\n if (!params.type || typeof params.type !== 'string' || printTypes.indexOf(params.type.toLowerCase()) === -1) {\n throw new Error('Invalid print type. Available types are: pdf, html, image and json.');\n } // Check if we are showing a feedback message to the user (useful for large files)\n\n\n if (params.showModal) _modal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].show(params); // Check for a print start hook function\n\n if (params.onLoadingStart) params.onLoadingStart(); // To prevent duplication and issues, remove any used printFrame from the DOM\n\n var usedFrame = document.getElementById(params.frameId);\n if (usedFrame) usedFrame.parentNode.removeChild(usedFrame); // Create a new iframe for the print job\n\n var printFrame = document.createElement('iframe');\n\n if (_browser__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFirefox()) {\n // Set the iframe to be is visible on the page (guaranteed by fixed position) but hidden using opacity 0, because\n // this works in Firefox. The height needs to be sufficient for some part of the document other than the PDF\n // viewer's toolbar to be visible in the page\n printFrame.setAttribute('style', 'width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0');\n } else {\n // Hide the iframe in other browsers\n printFrame.setAttribute('style', 'visibility: hidden; height: 0; width: 0; position: absolute; border: 0');\n } // Set iframe element id\n\n\n printFrame.setAttribute('id', params.frameId); // For non pdf printing, pass an html document string to srcdoc (force onload callback)\n\n if (params.type !== 'pdf') {\n printFrame.srcdoc = '' + params.documentTitle + ''; // Attach css files\n\n if (params.css) {\n // Add support for single file\n if (!Array.isArray(params.css)) params.css = [params.css]; // Create link tags for each css file\n\n params.css.forEach(function (file) {\n printFrame.srcdoc += '';\n });\n }\n\n printFrame.srcdoc += '';\n } // Check printable type\n\n\n switch (params.type) {\n case 'pdf':\n // Check browser support for pdf and if not supported we will just open the pdf file instead\n if (_browser__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isIE()) {\n try {\n console.info('Print.js doesn\\'t support PDF printing in Internet Explorer.');\n var win = window.open(params.fallbackPrintable, '_blank');\n win.focus();\n params.onIncompatibleBrowser();\n } catch (error) {\n params.onError(error);\n } finally {\n // Make sure there is no loading modal opened\n if (params.showModal) _modal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].close();\n if (params.onLoadingEnd) params.onLoadingEnd();\n }\n } else {\n _pdf__WEBPACK_IMPORTED_MODULE_2__[\"default\"].print(params, printFrame);\n }\n\n break;\n\n case 'image':\n _image__WEBPACK_IMPORTED_MODULE_5__[\"default\"].print(params, printFrame);\n break;\n\n case 'html':\n _html__WEBPACK_IMPORTED_MODULE_3__[\"default\"].print(params, printFrame);\n break;\n\n case 'raw-html':\n _raw_html__WEBPACK_IMPORTED_MODULE_4__[\"default\"].print(params, printFrame);\n break;\n\n case 'json':\n _json__WEBPACK_IMPORTED_MODULE_6__[\"default\"].print(params, printFrame);\n break;\n }\n }\n});\n\n/***/ }),\n\n/***/ \"./src/js/json.js\":\n/*!************************!*\\\n !*** ./src/js/json.js ***!\n \\************************/\n/*! exports provided: default */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./functions */ \"./src/js/functions.js\");\n/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./print */ \"./src/js/print.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n print: function print(params, printFrame) {\n // Check if we received proper data\n if (_typeof(params.printable) !== 'object') {\n throw new Error('Invalid javascript data object (JSON).');\n } // Validate repeatTableHeader\n\n\n if (typeof params.repeatTableHeader !== 'boolean') {\n throw new Error('Invalid value for repeatTableHeader attribute (JSON).');\n } // Validate properties\n\n\n if (!params.properties || !Array.isArray(params.properties)) {\n throw new Error('Invalid properties array for your JSON data.');\n } // We will format the property objects to keep the JSON api compatible with older releases\n\n\n params.properties = params.properties.map(function (property) {\n return {\n field: _typeof(property) === 'object' ? property.field : property,\n displayName: _typeof(property) === 'object' ? property.displayName : property,\n columnSize: _typeof(property) === 'object' && property.columnSize ? property.columnSize + ';' : 100 / params.properties.length + '%;'\n };\n }); // Create a print container element\n\n params.printableElement = document.createElement('div'); // Check if we are adding a print header\n\n if (params.header) {\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"addHeader\"])(params.printableElement, params);\n } // Build the printable html data\n\n\n params.printableElement.innerHTML += jsonToHTML(params); // Print the json data\n\n _print__WEBPACK_IMPORTED_MODULE_1__[\"default\"].send(params, printFrame);\n }\n});\n\nfunction jsonToHTML(params) {\n // Get the row and column data\n var data = params.printable;\n var properties = params.properties; // Create a html table\n\n var htmlData = '
'; // Check if the header should be repeated\n\n if (params.repeatTableHeader) {\n htmlData += '';\n } // Add the table header row\n\n\n htmlData += '
'; // Add the table header columns\n\n for (var a = 0; a < properties.length; a++) {\n htmlData += '
';\n } // Add the closing tag for the table header row\n\n\n htmlData += '
'; // If the table header is marked as repeated, add the closing tag\n\n if (params.repeatTableHeader) {\n htmlData += '';\n } // Create the table body\n\n\n htmlData += ''; // Add the table data rows\n\n for (var i = 0; i < data.length; i++) {\n // Add the row starting tag\n htmlData += '
'; // Print selected properties only\n\n for (var n = 0; n < properties.length; n++) {\n var stringData = data[i]; // Support nested objects\n\n var property = properties[n].field.split('.');\n\n if (property.length > 1) {\n for (var p = 0; p < property.length; p++) {\n stringData = stringData[property[p]];\n }\n } else {\n stringData = stringData[properties[n].field];\n } // Add the row contents and styles\n\n\n htmlData += '