{"version":3,"sources":["webpack://printJS/webpack/universalModuleDefinition","webpack://printJS/webpack/bootstrap","webpack://printJS/./src/index.js","webpack://printJS/./src/js/browser.js","webpack://printJS/./src/js/functions.js","webpack://printJS/./src/js/html.js","webpack://printJS/./src/js/image.js","webpack://printJS/./src/js/init.js","webpack://printJS/./src/js/json.js","webpack://printJS/./src/js/modal.js","webpack://printJS/./src/js/pdf.js","webpack://printJS/./src/js/print.js","webpack://printJS/./src/sass/index.scss"],"names":["printJS","print","init","window","Browser","isFirefox","InstallTrigger","isIE","navigator","userAgent","indexOf","document","documentMode","isEdge","StyleMedia","isChrome","context","chrome","isSafari","Object","prototype","toString","call","HTMLElement","toLowerCase","addWrapper","capitalizePrint","collectStyles","loopNodesCollectStyles","addHeader","htmlData","params","bodyStyle","font","font_size","obj","charAt","toUpperCase","slice","element","win","defaultView","elementStyle","styles","getComputedStyle","keys","map","targetStyles","targetStyle","key","targetStylesMatch","getPropertyValue","maxWidth","value","i","length","elements","n","currentElement","ignoreElements","getAttribute","parentNode","removeChild","tag","tagName","textStyle","parent","textNode","createTextNode","options","selectedIndex","text","textElement","createElement","appendChild","setAttribute","children","printElement","header","headerStyle","headerElement","headerNode","insertBefore","childNodes","printFrame","getElementById","printable","console","error","printableElement","cloneNode","scanStyles","honorMarginPadding","push","honorColor","innerHTML","Print","send","constructor","Array","loadImagesAndAppendToPrintableElement","then","outerHTML","promises","forEach","image","index","img","src","loadImageAndAppendToPrintableElement","Promise","all","onload","imageWrapper","imageStyle","resolve","printTypes","fallbackPrintable","type","properties","gridHeaderStyle","gridStyle","showModal","onError","onLoadingStart","onLoadingEnd","onPrintDialogClose","onPdfOpen","modalMessage","frameId","documentTitle","repeatTableHeader","css","style","args","arguments","undefined","Error","encodeURI","Modal","show","usedFrame","srcdoc","isArray","file","info","open","focus","e","close","Pdf","Image","Html","Json","field","property","displayName","columnSize","jsonToHTML","data","a","stringData","split","p","modalStyle","printModal","contentDiv","closeButton","spinner","messageNode","getElementsByTagName","addEventListener","test","location","origin","req","XMLHttpRequest","responseType","localPdf","Blob","response","URL","createObjectURL","iframeElement","finishPrint","printDocument","contentWindow","contentDocument","body","head","loadIframeImages","performPrint","execCommand","cleanUp","revokeObjectURL","event","handler","removeEventListener","loadIframeImage","pollImage","naturalWidth","setTimeout"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;AClFA;;AACA;;;;;;AAEA,IAAMA,UAAUC,eAAMC,IAAtB;;AAEA,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjCA,SAAOH,OAAP,GAAiBA,OAAjB;AACD;;kBAEcA,O;;;;;;;;;;;;;;;;;ACTf,IAAMI,UAAU;AACd;AACAC,aAAW,qBAAM;AACf,WAAO,OAAOC,cAAP,KAA0B,WAAjC;AACD,GAJa;AAKd;AACAC,QAAM,gBAAM;AACV,WAAOC,UAAUC,SAAV,CAAoBC,OAApB,CAA4B,MAA5B,MAAwC,CAAC,CAAzC,IAA8C,CAAC,CAACC,SAASC,YAAhE;AACD,GARa;AASd;AACAC,UAAQ,kBAAM;AACZ,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AAkD;AAChD,MAAIwE,WAAW,EAAf;;AAEAxE,SAAOuD,SAAP,CAAiBkB,OAAjB,CAAyB,UAACC,KAAD,EAAQC,KAAR;AAAA,WAAkBH,SAASV,IAAT,CAAcyG,gBAAgBb,aAAhB,EAA+B/E,KAA/B,CAAd,CAAlB;AAAA,GAAzB;;AAEA,SAAOI,QAAQC,GAAR,CAAYR,QAAZ,CAAP;AACD;;AAED,SAAS+F,eAAT,CAA0Bb,aAA1B,EAAyC/E,KAAzC,EAAgD;AAC9C,SAAO,IAAII,OAAJ,CAAY,mBAAW;AAC5B,QAAMyF,YAAY,SAAZA,SAAY,GAAM;AACtB,UAAI9F,QAAQgF,gBAAgBA,cAAcpG,cAAd,CAA6B,mBAAmBqB,KAAhD,CAAhB,GAAyE,IAArF;;AAEA,UAAI,CAACD,KAAD,IAAU,OAAOA,MAAM+F,YAAb,KAA8B,WAAxC,IAAuD/F,MAAM+F,YAAN,KAAuB,CAAlF,EAAqF;AACnFC,mBAAWF,SAAX,EAAsB,GAAtB;AACD,OAFD,MAEO;AACLpF;AACD;AACF,KARD;AASAoF;AACD,GAXM,CAAP;AAYD;;kBAEcvG,K;;;;;;;;;;;ACjIf,uC","file":"print.js","sourcesContent":["(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 "," \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","import './sass/index.scss'\nimport print from './js/init'\n\nconst printJS = print.init\n\nif (typeof window !== 'undefined') {\n  window.printJS = printJS\n}\n\nexport default printJS\n","const Browser = {\n  // Firefox 1.0+\n  isFirefox: () => {\n    return typeof InstallTrigger !== 'undefined'\n  },\n  // Internet Explorer 6-11\n  isIE: () => {\n    return navigator.userAgent.indexOf('MSIE') !== -1 || !!document.documentMode\n  },\n  // Edge 20+\n  isEdge: () => {\n    return !Browser.isIE() && !!window.StyleMedia\n  },\n  // Chrome 1+\n  isChrome: (context = window) => {\n    return !!context.chrome\n  },\n  // At least Safari 3+: \"[object HTMLElementConstructor]\"\n  isSafari: () => {\n    return Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0 ||\n        navigator.userAgent.toLowerCase().indexOf('safari') !== -1\n  }\n}\n\nexport default Browser\n","export function addWrapper (htmlData, params) {\n  let bodyStyle = 'font-family:' + params.font + ' !important; font-size: ' + params.font_size + ' !important; width:100%;'\n  return '<div style=\"' + bodyStyle + '\">' + htmlData + '</div>'\n}\n\nexport function capitalizePrint (obj) {\n  return obj.charAt(0).toUpperCase() + obj.slice(1)\n}\n\nexport function collectStyles (element, params) {\n  let win = document.defaultView || window\n\n  // String variable to hold styling for each element\n  let elementStyle = ''\n\n  // Loop over computed styles\n  let styles = win.getComputedStyle(element, '')\n\n  Object.keys(styles).map(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  })\n\n  // Print friendly defaults\n  elementStyle += 'max-width: ' + params.maxWidth + 'px !important;' + params.font_size + ' !important;'\n\n  return elementStyle\n}\n\nfunction targetStylesMatch (styles, value) {\n  for (let i = 0; i < styles.length; i++) {\n    if (typeof value === 'object' && value.indexOf(styles[i]) !== -1) return true\n  }\n  return false\n}\n\nexport function loopNodesCollectStyles (elements, params) {\n  for (let n = 0; n < elements.length; n++) {\n    let currentElement = elements[n]\n\n    // Check if we are skiping this element\n    if (params.ignoreElements.indexOf(currentElement.getAttribute('id')) !== -1) {\n      currentElement.parentNode.removeChild(currentElement)\n      continue\n    }\n\n    // Form Printing - check if is element Input\n    let tag = currentElement.tagName\n    if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') {\n      // Save style to variable\n      let textStyle = collectStyles(currentElement, params)\n\n      // Remove INPUT element and insert a text node\n      let parent = currentElement.parentNode\n\n      // Get text value\n      let textNode = tag === 'SELECT'\n        ? document.createTextNode(currentElement.options[currentElement.selectedIndex].text)\n        : document.createTextNode(currentElement.value)\n\n      // Create text element\n      let textElement = document.createElement('div')\n      textElement.appendChild(textNode)\n\n      // Add style to text\n      textElement.setAttribute('style', textStyle)\n\n      // Add text\n      parent.appendChild(textElement)\n\n      // Remove input\n      parent.removeChild(currentElement)\n    } else {\n      // Get all styling for print element\n      currentElement.setAttribute('style', collectStyles(currentElement, params))\n    }\n\n    // Check if more elements in tree\n    let children = currentElement.children\n\n    if (children && children.length) {\n      loopNodesCollectStyles(children, params)\n    }\n  }\n}\n\nexport function addHeader (printElement, header, headerStyle) {\n  // Create header element\n  let headerElement = document.createElement('h1')\n\n  // Create header text node\n  let headerNode = document.createTextNode(header)\n\n  // Build and style\n  headerElement.appendChild(headerNode)\n  headerElement.setAttribute('style', headerStyle)\n\n  printElement.insertBefore(headerElement, printElement.childNodes[0])\n}\n","import { collectStyles, loopNodesCollectStyles, addWrapper, addHeader } from './functions'\nimport Print from './print'\n\nexport default {\n  print: (params, printFrame) => {\n    // Get HTML printable element\n    let printElement = document.getElementById(params.printable)\n\n    // Check if element exists\n    if (!printElement) {\n      window.console.error('Invalid HTML element id: ' + params.printable)\n\n      return false\n    }\n\n    // Make a copy of the printElement to prevent DOM changes\n    let printableElement = document.createElement('div')\n    printableElement.appendChild(printElement.cloneNode(true))\n\n    // Add cloned element to DOM, to have DOM element methods available. It will also be easier to colect styles\n    printableElement.setAttribute('style', 'height:0; overflow:hidden;')\n    printableElement.setAttribute('id', 'printJS-html')\n    printElement.parentNode.appendChild(printableElement)\n\n    // Update printableElement variable with newly created DOM element\n    printableElement = document.getElementById('printJS-html')\n\n    // Process html styles\n    if (params.scanStyles === true) {\n      // Optional - include margin and padding\n      if (params.honorMarginPadding) params.targetStyles.push('margin', 'padding')\n\n      // Optional - include color\n      if (params.honorColor) params.targetStyles.push('color')\n\n      // Get main element styling\n      printableElement.setAttribute('style', collectStyles(printableElement, params) + 'margin:0 !important;')\n\n      // Get all children elements\n      let elements = printableElement.children\n\n      // Get styles for all children elements\n      loopNodesCollectStyles(elements, params)\n    }\n\n    // Add header\n    if (params.header) {\n      addHeader(printableElement, params.header, params.headerStyle)\n    }\n\n    // Remove DOM printableElement\n    printableElement.parentNode.removeChild(printableElement)\n\n    // Store html data\n    params.htmlData = addWrapper(printableElement.innerHTML, params)\n\n    // Print html element contents\n    Print.send(params, printFrame)\n  }\n}\n","import { addHeader } from './functions'\nimport Print from './print'\n\nexport default {\n  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    }\n\n    // Create printable element (container)\n    let printableElement = document.createElement('div')\n    printableElement.setAttribute('style', 'width:100%')\n\n    // Load images and append\n    loadImagesAndAppendToPrintableElement(printableElement, params).then(() => {\n      // Check if we are adding a header\n      if (params.header) addHeader(printableElement, params.header, params.headerStyle)\n\n      // Store html data\n      params.htmlData = printableElement.outerHTML\n\n      // Print image\n      Print.send(params, printFrame)\n    })\n  }\n}\n\nfunction loadImagesAndAppendToPrintableElement (printableElement, params) {\n  let promises = []\n\n  params.printable.forEach((image, index) => {\n    // Create the image element\n    let img = document.createElement('img')\n\n    // Set image src with image file url\n    img.src = image\n\n    // Load image\n    promises.push(loadImageAndAppendToPrintableElement(printableElement, params, img, index))\n  })\n\n  return Promise.all(promises)\n}\n\nfunction loadImageAndAppendToPrintableElement (printableElement, params, img, index) {\n  return new Promise(resolve => {\n    img.onload = () => {\n      // Create image wrapper\n      let imageWrapper = document.createElement('div')\n      imageWrapper.setAttribute('style', params.imageStyle)\n\n      img.setAttribute('style', 'width:100%;')\n      img.setAttribute('id', 'printableImage' + index)\n\n      // Append image to wrapper element\n      imageWrapper.appendChild(img)\n\n      // Append wrapper element to printable element\n      printableElement.appendChild(imageWrapper)\n\n      resolve()\n    }\n  })\n}\n","'use strict'\n\nimport Browser from './browser'\nimport Modal from './modal'\nimport Pdf from './pdf'\nimport Html from './html'\nimport Image from './image'\nimport Json from './json'\n\nlet printTypes = ['pdf', 'html', 'image', 'json']\n\nexport default {\n  init () {\n    let params = {\n      printable: null,\n      fallbackPrintable: null,\n      type: 'pdf',\n      header: null,\n      headerStyle: 'font-weight: 300;',\n      maxWidth: 800,\n      font: 'TimesNewRoman',\n      font_size: '12pt',\n      honorMarginPadding: true,\n      honorColor: false,\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: (error) => { throw error },\n      onLoadingStart: null,\n      onLoadingEnd: null,\n      onPrintDialogClose: null,\n      onPdfOpen: null,\n      modalMessage: 'Retrieving Document...',\n      frameId: 'printJS',\n      htmlData: '',\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      imageStyle: 'width:100%;',\n      repeatTableHeader: true,\n      css: null,\n      style: null,\n      scanStyles: true\n    }\n\n    // Check if a printable document or object was supplied\n    let args = arguments[0]\n    if (args === undefined) throw new Error('printJS expects at least 1 attribute.')\n\n    // Process parameters\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      case 'object':\n        params.printable = args.printable\n        params.fallbackPrintable = typeof args.fallbackPrintable !== 'undefined' ? args.fallbackPrintable : params.printable\n        params.type = typeof args.type !== 'undefined' ? args.type : params.type\n        params.frameId = typeof args.frameId !== 'undefined' ? args.frameId : params.frameId\n        params.header = typeof args.header !== 'undefined' ? args.header : params.header\n        params.headerStyle = typeof args.headerStyle !== 'undefined' ? args.headerStyle : params.headerStyle\n        params.maxWidth = typeof args.maxWidth !== 'undefined' ? args.maxWidth : params.maxWidth\n        params.font = typeof args.font !== 'undefined' ? args.font : params.font\n        params.font_size = typeof args.font_size !== 'undefined' ? args.font_size : params.font_size\n        params.honorMarginPadding = typeof args.honorMarginPadding !== 'undefined' ? args.honorMarginPadding : params.honorMarginPadding\n        params.properties = typeof args.properties !== 'undefined' ? args.properties : params.properties\n        params.gridHeaderStyle = typeof args.gridHeaderStyle !== 'undefined' ? args.gridHeaderStyle : params.gridHeaderStyle\n        params.gridStyle = typeof args.gridStyle !== 'undefined' ? args.gridStyle : params.gridStyle\n        params.showModal = typeof args.showModal !== 'undefined' ? args.showModal : params.showModal\n        params.onError = typeof args.onError !== 'undefined' ? args.onError : params.onError\n        params.onLoadingStart = typeof args.onLoadingStart !== 'undefined' ? args.onLoadingStart : params.onLoadingStart\n        params.onLoadingEnd = typeof args.onLoadingEnd !== 'undefined' ? args.onLoadingEnd : params.onLoadingEnd\n        params.onPrintDialogClose = typeof args.onPrintDialogClose !== 'undefined' ? args.onPrintDialogClose : params.onPrintDialogClose\n        params.onPdfOpen = typeof args.onPdfOpen !== 'undefined' ? args.onPdfOpen : params.onPdfOpen\n        params.modalMessage = typeof args.modalMessage !== 'undefined' ? args.modalMessage : params.modalMessage\n        params.documentTitle = typeof args.documentTitle !== 'undefined' ? args.documentTitle : params.documentTitle\n        params.targetStyle = typeof args.targetStyle !== 'undefined' ? args.targetStyle : params.targetStyle\n        params.targetStyles = typeof args.targetStyles !== 'undefined' ? args.targetStyles : params.targetStyles\n        params.ignoreElements = typeof args.ignoreElements !== 'undefined' ? args.ignoreElements : params.ignoreElements\n        params.imageStyle = typeof args.imageStyle !== 'undefined' ? args.imageStyle : params.imageStyle\n        params.repeatTableHeader = typeof args.repeatTableHeader !== 'undefined' ? args.repeatTableHeader : params.repeatTableHeader\n        params.css = typeof args.css !== 'undefined' ? args.css : params.css\n        params.style = typeof args.style !== 'undefined' ? args.style : params.style\n        params.scanStyles = typeof args.scanStyles !== 'undefined' ? args.scanStyles : params.scanStyles\n        break\n      default:\n        throw new Error('Unexpected argument type! Expected \"string\" or \"object\", got ' + typeof args)\n    }\n\n    // Validate printable\n    if (!params.printable) throw new Error('Missing printable information.')\n\n    // Validate type\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    }\n\n    // Check if we are showing a feedback message to the user (useful for large files)\n    if (params.showModal) Modal.show(params)\n\n    // Check for a print start hook function\n    if (params.onLoadingStart) params.onLoadingStart()\n\n    // To prevent duplication and issues, remove any used printFrame from the DOM\n    let usedFrame = document.getElementById(params.frameId)\n\n    if (usedFrame) usedFrame.parentNode.removeChild(usedFrame)\n\n    // Create a new iframe or embed element (IE prints blank pdf's if we use iframe)\n    let printFrame\n\n    // Create iframe element\n    printFrame = document.createElement('iframe')\n\n    // Hide iframe\n    printFrame.setAttribute('style', 'visibility: hidden; height: 0; width: 0; position: absolute;')\n\n    // Set iframe element id\n    printFrame.setAttribute('id', params.frameId)\n\n    // For non pdf printing, pass an html document string to srcdoc (force onload callback)\n    if (params.type !== 'pdf') {\n      printFrame.srcdoc = '<html><head><title>' + params.documentTitle + '</title>'\n\n      // Attach css files\n      if (params.css !== null) {\n        // Add support for single file\n        if (!Array.isArray(params.css)) params.css = [params.css]\n\n        // Create link tags for each css file\n        params.css.forEach(file => {\n          printFrame.srcdoc += '<link rel=\"stylesheet\" href=\"' + file + '\">'\n        })\n      }\n\n      printFrame.srcdoc += '</head><body></body></html>'\n    }\n\n    // Check printable type\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.isFirefox() || Browser.isEdge() || Browser.isIE()) {\n          try {\n            console.info('PrintJS currently doesn\\'t support PDF printing in Firefox, Internet Explorer and Edge.')\n            let win = window.open(params.fallbackPrintable, '_blank')\n            win.focus()\n            if (params.onPdfOpen) params.onPdfOpen()\n          } catch (e) {\n            params.onError(e)\n          } finally {\n            // Make sure there is no loading modal opened\n            if (params.showModal) Modal.close()\n            if (params.onLoadingEnd) params.onLoadingEnd()\n          }\n        } else {\n          Pdf.print(params, printFrame)\n        }\n        break\n      case 'image':\n        Image.print(params, printFrame)\n        break\n      case 'html':\n        Html.print(params, printFrame)\n        break\n      case 'json':\n        Json.print(params, printFrame)\n        break\n    }\n  }\n}\n","import {\n  addWrapper,\n  capitalizePrint\n} from './functions'\nimport Print from './print'\n\nexport default {\n  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    }\n\n    // Validate repeatTableHeader\n    if (typeof params.repeatTableHeader !== 'boolean') {\n      throw new Error('Invalid value for repeatTableHeader attribute (JSON).')\n    }\n\n    // Validate properties\n    if (!params.properties || !Array.isArray(params.properties)) {\n      throw new Error('Invalid properties array for your JSON data.')\n    }\n\n    // We will format the property objects to keep the JSON api compatible with older releases\n    params.properties = params.properties.map(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    })\n\n    // Variable to hold the html string\n    let htmlData = ''\n\n    // Check if there is a header on top of the table\n    if (params.header) htmlData += '<h1 style=\"' + params.headerStyle + '\">' + params.header + '</h1>'\n\n    // Build the printable html data\n    htmlData += jsonToHTML(params)\n\n    // Store the data\n    params.htmlData = addWrapper(htmlData, params)\n\n    // Print the json data\n    Print.send(params, printFrame)\n  }\n}\n\nfunction jsonToHTML (params) {\n  // Get the row and column data\n  let data = params.printable\n  let properties = params.properties\n\n  // Create a html table\n  let htmlData = '<table style=\"border-collapse: collapse; width: 100%;\">'\n\n  // Check if the header should be repeated\n  if (params.repeatTableHeader) {\n    htmlData += '<thead>'\n  }\n\n  // Add the table header row\n  htmlData += '<tr>'\n\n  // Add the table header columns\n  for (let a = 0; a < properties.length; a++) {\n    htmlData += '<th style=\"width:' + properties[a].columnSize + ';' + params.gridHeaderStyle + '\">' + capitalizePrint(properties[a].displayName) + '</th>'\n  }\n\n  // Add the closing tag for the table header row\n  htmlData += '</tr>'\n\n  // If the table header is marked as repeated, add the closing tag\n  if (params.repeatTableHeader) {\n    htmlData += '</thead>'\n  }\n\n  // Create the table body\n  htmlData += '<tbody>'\n\n  // Add the table data rows\n  for (let i = 0; i < data.length; i++) {\n    // Add the row starting tag\n    htmlData += '<tr>'\n\n    // Print selected properties only\n    for (let n = 0; n < properties.length; n++) {\n      let stringData = data[i]\n\n      // Support nested objects\n      let property = properties[n].field.split('.')\n      if (property.length > 1) {\n        for (let p = 0; p < property.length; p++) {\n          stringData = stringData[property[p]]\n        }\n      } else {\n        stringData = stringData[properties[n].field]\n      }\n\n      // Add the row contents and styles\n      htmlData += '<td style=\"width:' + properties[n].columnSize + params.gridStyle + '\">' + stringData + '</td>'\n    }\n\n    // Add the row closing tag\n    htmlData += '</tr>'\n  }\n\n  // Add the table and body closing tags\n  htmlData += '</tbody></table>'\n\n  return htmlData\n}\n","const Modal = {\n  show (params) {\n    // Build modal\n    let modalStyle = 'font-family:sans-serif; ' +\n        'display:table; ' +\n        'text-align:center; ' +\n        'font-weight:300; ' +\n        'font-size:30px; ' +\n        'left:0; top:0;' +\n        'position:fixed; ' +\n        'z-index: 9990;' +\n        'color: #0460B5; ' +\n        'width: 100%; ' +\n        'height: 100%; ' +\n        'background-color:rgba(255,255,255,.9);' +\n        'transition: opacity .3s ease;'\n\n    // Create wrapper\n    let printModal = document.createElement('div')\n    printModal.setAttribute('style', modalStyle)\n    printModal.setAttribute('id', 'printJS-Modal')\n\n    // Create content div\n    let contentDiv = document.createElement('div')\n    contentDiv.setAttribute('style', 'display:table-cell; vertical-align:middle; padding-bottom:100px;')\n\n    // Add close button (requires print.css)\n    let closeButton = document.createElement('div')\n    closeButton.setAttribute('class', 'printClose')\n    closeButton.setAttribute('id', 'printClose')\n    contentDiv.appendChild(closeButton)\n\n    // Add spinner (requires print.css)\n    let spinner = document.createElement('span')\n    spinner.setAttribute('class', 'printSpinner')\n    contentDiv.appendChild(spinner)\n\n    // Add message\n    let messageNode = document.createTextNode(params.modalMessage)\n    contentDiv.appendChild(messageNode)\n\n    // Add contentDiv to printModal\n    printModal.appendChild(contentDiv)\n\n    // Append print modal element to document body\n    document.getElementsByTagName('body')[0].appendChild(printModal)\n\n    // Add event listener to close button\n    document.getElementById('printClose').addEventListener('click', function () {\n      Modal.close()\n    })\n  },\n  close () {\n    let printFrame = document.getElementById('printJS-Modal')\n\n    printFrame.parentNode.removeChild(printFrame)\n  }\n}\n\nexport default Modal\n","import Print from './print'\n\nexport default {\n  print: (params, printFrame) => {\n    // Format pdf url\n    params.printable = /^(blob|http)/i.test(params.printable)\n      ? params.printable\n      : window.location.origin + (params.printable.charAt(0) !== '/' ? '/' + params.printable : params.printable)\n\n    // If showing a loading modal or using a hook function, we will preload the pdf file\n    if (params.showModal || params.onLoadingStart) {\n      // Get the file through a http request\n      let req = new window.XMLHttpRequest()\n      req.responseType = 'arraybuffer'\n\n      req.addEventListener('load', () => {\n        // Pass response data to a blob and create a local object url\n        let localPdf = new window.Blob([req.response], { type: 'application/pdf' })\n        localPdf = window.URL.createObjectURL(localPdf)\n\n        // Pass the url to the printable parameter (replacing the original pdf file url)\n        // This will prevent a second request to the file (server) once the iframe loads\n        params.printable = localPdf\n\n        send(params, printFrame)\n      })\n\n      req.open('GET', params.printable, true)\n      req.send()\n    } else {\n      send(params, printFrame)\n    }\n  }\n}\n\nfunction send (params, printFrame) {\n  // Set iframe src with pdf document url\n  printFrame.setAttribute('src', params.printable)\n  Print.send(params, printFrame)\n}\n","import Browser from './browser'\nimport Modal from './modal'\n\nconst Print = {\n  send: (params, printFrame) => {\n    // Append iframe element to document body\n    document.getElementsByTagName('body')[0].appendChild(printFrame)\n\n    // Get iframe element\n    let iframeElement = document.getElementById(params.frameId)\n\n    // Wait for iframe to load all content\n    if (params.type === 'pdf' && (Browser.isIE() || Browser.isEdge())) {\n      iframeElement.setAttribute('onload', finishPrint(iframeElement, params))\n    } else {\n      printFrame.onload = () => {\n        if (params.type === 'pdf') {\n          finishPrint(iframeElement, params)\n        } else {\n          // Get iframe element document\n          let printDocument = (iframeElement.contentWindow || iframeElement.contentDocument)\n          if (printDocument.document) printDocument = printDocument.document\n\n          // Inject printable html into iframe body\n          printDocument.body.innerHTML = params.htmlData\n\n          // Add custom style\n          if (params.type !== 'pdf' && params.style !== null) {\n            // Create style element\n            const style = document.createElement('style')\n            style.innerHTML = params.style\n\n            // Append style element to iframe's head\n            printDocument.head.appendChild(style)\n          }\n\n          // If printing image, wait for it to load inside the iframe\n          if (params.type === 'image') {\n            loadIframeImages(printDocument, params).then(() => {\n              finishPrint(iframeElement, params)\n            })\n          } else {\n            finishPrint(iframeElement, params)\n          }\n        }\n      }\n    }\n  }\n}\n\nfunction performPrint (iframeElement, params) {\n  iframeElement.focus()\n\n  // If Edge or IE, try catch with execCommand\n  if (Browser.isEdge() || Browser.isIE()) {\n    try {\n      iframeElement.contentWindow.document.execCommand('print', false, null)\n    } catch (e) {\n      iframeElement.contentWindow.print()\n    }\n  } else {\n    // Other browsers\n    iframeElement.contentWindow.print()\n  }\n}\n\nfunction cleanUp (params) {\n  // If we are showing a feedback message to user, remove it\n  if (params.showModal) Modal.close()\n\n  // Check for a finished loading hook function\n  if (params.onLoadingEnd) params.onLoadingEnd()\n\n  // If preloading pdf files, clean blob url\n  if (params.showModal || params.onLoadingStart) window.URL.revokeObjectURL(params.printable)\n\n  // If a onPrintDialogClose callback is given, execute it\n  if (params.onPrintDialogClose) {\n    let event = 'mouseover'\n\n    if (Browser.isChrome() || Browser.isFirefox()) {\n      // Firefox will require an extra click in the document\n      // to fire the focus event. Should we console.warn that?\n      event = 'focus'\n    }\n    const handler = () => {\n      // Make sure the event only happens once.\n      window.removeEventListener(event, handler)\n\n      params.onPrintDialogClose()\n    }\n\n    window.addEventListener(event, handler)\n  }\n}\n\nfunction finishPrint (iframeElement, params) {\n  try {\n    performPrint(iframeElement, params)\n  } catch (error) {\n    params.onError(error)\n  } finally {\n    cleanUp(params)\n  }\n}\n\nfunction loadIframeImages (printDocument, params) {\n  let promises = []\n\n  params.printable.forEach((image, index) => promises.push(loadIframeImage(printDocument, index)))\n\n  return Promise.all(promises)\n}\n\nfunction loadIframeImage (printDocument, index) {\n  return new Promise(resolve => {\n    const pollImage = () => {\n      let image = printDocument ? printDocument.getElementById('printableImage' + index) : null\n\n      if (!image || typeof image.naturalWidth === 'undefined' || image.naturalWidth === 0) {\n        setTimeout(pollImage, 500)\n      } else {\n        resolve()\n      }\n    }\n    pollImage()\n  })\n}\n\nexport default Print\n","// extracted by mini-css-extract-plugin"],"sourceRoot":""}