From d6e69dab2c194ffd135f42e79b67a0f7c51709b2 Mon Sep 17 00:00:00 2001 From: Simon Bengtsson Date: Thu, 9 Apr 2020 16:40:21 +0200 Subject: [PATCH] 3.4.1 --- dist/jspdf.plugin.autotable.js | 294 ++++++++++------------------- dist/jspdf.plugin.autotable.min.js | 9 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 104 insertions(+), 203 deletions(-) diff --git a/dist/jspdf.plugin.autotable.js b/dist/jspdf.plugin.autotable.js index 3f21e64c..d8c777ab 100644 --- a/dist/jspdf.plugin.autotable.js +++ b/dist/jspdf.plugin.autotable.js @@ -1,6 +1,6 @@ /*! * - * jsPDF AutoTable plugin v3.4.0 + * jsPDF AutoTable plugin v3.4.1 * * Copyright (c) 2020 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable * Licensed under the MIT License. @@ -16,7 +16,7 @@ var a = typeof exports === 'object' ? factory((function webpackLoadOptionalExternalModule() { try { return require("jspdf"); } catch(e) {} }())) : factory(root["jsPDF"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } -})(this, function(__WEBPACK_EXTERNAL_MODULE__17__) { +})(this, function(__WEBPACK_EXTERNAL_MODULE__16__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -100,7 +100,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 8); +/******/ return __webpack_require__(__webpack_require__.s = 7); /******/ }) /************************************************************************/ /******/ ([ @@ -193,6 +193,17 @@ exports.setDefaults = setDefaults; "use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; var __spreadArrays = (this && this.__spreadArrays) || function () { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) @@ -203,16 +214,15 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { Object.defineProperty(exports, "__esModule", { value: true }); var config_1 = __webpack_require__(2); var state_1 = __webpack_require__(0); -var polyfills_1 = __webpack_require__(5); +var polyfills_1 = __webpack_require__(3); function getStringWidth(text, styles) { - applyStyles(styles); + applyStyles(styles, true); var textArr = Array.isArray(text) ? text : [text]; var widestLineWidth = textArr .map(function (text) { return state_1.default().doc.getTextWidth(text); }) // Shave off a few digits for potential improvement in width calculation .map(function (val) { return Math.floor(val * 10000) / 10000; }) .reduce(function (a, b) { return Math.max(a, b); }, 0); - var fontSize = styles.fontSize / state_1.default().scaleFactor(); return widestLineWidth; } exports.getStringWidth = getStringWidth; @@ -222,11 +232,7 @@ exports.getStringWidth = getStringWidth; function ellipsize(text, width, styles, ellipsizeStr) { if (ellipsizeStr === void 0) { ellipsizeStr = '...'; } if (Array.isArray(text)) { - var value_1 = []; - text.forEach(function (str, i) { - value_1[i] = ellipsize(str, width, styles, ellipsizeStr); - }); - return value_1; + return text.map(function (str) { return ellipsize(str, width, styles, ellipsizeStr); }); } var precision = 10000 * state_1.default().scaleFactor(); width = Math.ceil(width * precision) / precision; @@ -276,17 +282,16 @@ function applyUserStyles() { applyStyles(state_1.default().table.userStyles); } exports.applyUserStyles = applyUserStyles; -function applyStyles(styles) { +function applyStyles(styles, fontOnly) { + if (fontOnly === void 0) { fontOnly = false; } var doc = state_1.default().doc; - var styleModifiers = { + var nonFontModifiers = { fillColor: doc.setFillColor, textColor: doc.setTextColor, - fontStyle: doc.setFontStyle, lineColor: doc.setDrawColor, lineWidth: doc.setLineWidth, - font: doc.setFont, - fontSize: doc.setFontSize, }; + var styleModifiers = __assign({ font: doc.setFont, fontSize: doc.setFontSize, fontStyle: doc.setFontStyle }, (fontOnly ? {} : nonFontModifiers)); Object.keys(styleModifiers).forEach(function (name) { var style = styles[name]; var modifier = styleModifiers[name]; @@ -485,6 +490,45 @@ exports.getTheme = getTheme; "use strict"; +/* + * Include common small polyfills instead of requiring the user to to do it + */ +Object.defineProperty(exports, "__esModule", { value: true }); +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign +function assign(target) { + 'use strict'; + var varArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + varArgs[_i - 1] = arguments[_i]; + } + if (target == null) { + // TypeError if undefined or null + throw new TypeError('Cannot convert undefined or null to object'); + } + var to = Object(target); + for (var index = 1; index < arguments.length; index++) { + var nextSource = arguments[index]; + if (nextSource != null) { + // Skip over if undefined or null + for (var nextKey in nextSource) { + // Avoid bugs when hasOwnProperty is shadowed + if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { + to[nextKey] = nextSource[nextKey]; + } + } + } + } + return to; +} +exports.assign = assign; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); /** * Improved text function with halign and valign support @@ -499,7 +543,7 @@ function default_1(text, x, y, styles, doc) { var k = doc.internal.scaleFactor; var fontSize = doc.internal.getFontSize() / k; var splitRegex = /\r\n|\r|\n/g; - var splitText = null; + var splitText = ''; var lineCount = 1; if (styles.valign === 'middle' || styles.valign === 'bottom' || @@ -542,13 +586,13 @@ exports.default = default_1; /***/ }), -/* 4 */ +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var cssParser_1 = __webpack_require__(10); +var cssParser_1 = __webpack_require__(9); var state_1 = __webpack_require__(0); function parseHtml(input, includeHiddenHtml, useCss) { if (includeHiddenHtml === void 0) { includeHiddenHtml = false; } @@ -560,11 +604,11 @@ function parseHtml(input, includeHiddenHtml, useCss) { else { tableElement = input; } + var head = [], body = [], foot = []; if (!tableElement) { console.error('Html table could not be found with input: ', input); - return; + return { head: head, body: body, foot: foot }; } - var head = [], body = [], foot = []; for (var _i = 0, _a = tableElement.rows; _i < _a.length; _i++) { var rowNode = _a[_i]; var tagName = rowNode.parentNode.tagName.toLowerCase(); @@ -630,45 +674,6 @@ function parseCellContent(orgCell) { } -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/* - * Include common small polyfills instead of requiring the user to to do it - */ -Object.defineProperty(exports, "__esModule", { value: true }); -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign -function assign(target) { - 'use strict'; - var varArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - varArgs[_i - 1] = arguments[_i]; - } - if (target == null) { - // TypeError if undefined or null - throw new TypeError('Cannot convert undefined or null to object'); - } - var to = Object(target); - for (var index = 1; index < arguments.length; index++) { - var nextSource = arguments[index]; - if (nextSource != null) { - // Skip over if undefined or null - for (var nextKey in nextSource) { - // Avoid bugs when hasOwnProperty is shadowed - if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { - to[nextKey] = nextSource[nextKey]; - } - } - } - } - return to; -} -exports.assign = assign; - - /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { @@ -678,9 +683,9 @@ exports.assign = assign; Object.defineProperty(exports, "__esModule", { value: true }); var config_1 = __webpack_require__(2); var state_1 = __webpack_require__(0); -var HookData_1 = __webpack_require__(13); +var HookData_1 = __webpack_require__(12); var common_1 = __webpack_require__(1); -var assign = __webpack_require__(7); +var polyfills_1 = __webpack_require__(3); var CellHooks = /** @class */ (function () { function CellHooks() { this.didParseCell = []; @@ -795,7 +800,7 @@ var Cell = /** @class */ (function () { this.textPos = {}; this.rowSpan = (raw && raw.rowSpan) || 1; this.colSpan = (raw && raw.colSpan) || 1; - this.styles = assign(themeStyles, (raw && raw.styles) || {}); + this.styles = polyfills_1.assign(themeStyles, (raw && raw.styles) || {}); this.section = section; var text; var content = raw && raw.content != null ? raw.content : raw; @@ -856,107 +861,10 @@ exports.Column = Column; /* 7 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var applyPlugin_1 = __webpack_require__(9); +var applyPlugin_1 = __webpack_require__(8); // export { applyPlugin } didn't export applyPlugin // to index.d.ts for some reason function applyPlugin(jsPDF) { @@ -964,7 +872,7 @@ function applyPlugin(jsPDF) { } exports.applyPlugin = applyPlugin; try { - var jsPDF = __webpack_require__(17); + var jsPDF = __webpack_require__(16); applyPlugin(jsPDF); } catch (error) { @@ -975,17 +883,17 @@ catch (error) { /***/ }), -/* 9 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var state_1 = __webpack_require__(0); -__webpack_require__(3); -var htmlParser_1 = __webpack_require__(4); -var autoTableText_1 = __webpack_require__(3); -var autoTable_1 = __webpack_require__(11); +__webpack_require__(4); +var htmlParser_1 = __webpack_require__(5); +var autoTableText_1 = __webpack_require__(4); +var autoTable_1 = __webpack_require__(10); function default_1(jsPDF) { jsPDF.API.autoTable = autoTable_1.default; // Assign false to enable `doc.lastAutoTable.finalY || 40` sugar @@ -1050,7 +958,7 @@ exports.default = default_1; /***/ }), -/* 10 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1158,16 +1066,16 @@ function parsePadding(val, fontSize, lineHeight, scaleFactor) { /***/ }), -/* 11 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var state_1 = __webpack_require__(0); -var inputParser_1 = __webpack_require__(12); -var widthCalculator_1 = __webpack_require__(15); -var tableDrawer_1 = __webpack_require__(16); +var inputParser_1 = __webpack_require__(11); +var widthCalculator_1 = __webpack_require__(14); +var tableDrawer_1 = __webpack_require__(15); var common_1 = __webpack_require__(1); function autoTable() { var args = []; @@ -1193,7 +1101,7 @@ exports.default = autoTable; /***/ }), -/* 12 */ +/* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1208,11 +1116,11 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { Object.defineProperty(exports, "__esModule", { value: true }); var models_1 = __webpack_require__(6); var config_1 = __webpack_require__(2); -var htmlParser_1 = __webpack_require__(4); -var polyfills_1 = __webpack_require__(5); +var htmlParser_1 = __webpack_require__(5); +var polyfills_1 = __webpack_require__(3); var common_1 = __webpack_require__(1); var state_1 = __webpack_require__(0); -var inputValidator_1 = __webpack_require__(14); +var inputValidator_1 = __webpack_require__(13); /** * Create models from the user input */ @@ -1459,11 +1367,10 @@ function generateSectionRowFromColumnData(table, sectionName) { } function getTableColumns(settings) { if (settings.columns) { - var cols = settings.columns.map(function (input, index) { + return settings.columns.map(function (input, index) { var key = input.dataKey || input.key || index; return new models_1.Column(key, input, index); }); - return cols; } else { var firstRow_1 = settings.head[0] || settings.body[0] || settings.foot[0] || []; @@ -1507,7 +1414,7 @@ function cellStyles(sectionName, column, rowIndex) { /***/ }), -/* 13 */ +/* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1556,7 +1463,7 @@ exports.CellHookData = CellHookData; /***/ }), -/* 14 */ +/* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1681,7 +1588,7 @@ function checkStyles(styles) { /***/ }), -/* 15 */ +/* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1822,21 +1729,20 @@ function applyColSpans(table) { var colSpansLeft = 0; for (var columnIndex = 0; columnIndex < table.columns.length; columnIndex++) { var column = table.columns[columnIndex]; - var cell = null; // Width and colspan colSpansLeft -= 1; if (colSpansLeft > 1 && table.columns[columnIndex + 1]) { combinedColSpanWidth += column.width; delete row.cells[column.index]; - continue; } else if (colSpanCell) { - cell = colSpanCell; + var cell = colSpanCell; delete row.cells[column.index]; colSpanCell = null; + cell.width = column.width + combinedColSpanWidth; } else { - cell = row.cells[column.index]; + var cell = row.cells[column.index]; if (!cell) continue; colSpansLeft = cell.colSpan; @@ -1846,8 +1752,8 @@ function applyColSpans(table) { combinedColSpanWidth += column.width; continue; } + cell.width = column.width + combinedColSpanWidth; } - cell.width = column.width + combinedColSpanWidth; } } } @@ -1860,7 +1766,7 @@ function fitContent(table) { var cell = row.cells[column.index]; if (!cell) continue; - common_1.applyStyles(cell.styles); + common_1.applyStyles(cell.styles, true); var textSpace = cell.width - cell.padding('horizontal'); if (cell.styles.overflow === 'linebreak') { // Add one pt to textSpace to fix rounding error @@ -1901,7 +1807,7 @@ function fitContent(table) { /***/ }), -/* 16 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1911,7 +1817,7 @@ var config_1 = __webpack_require__(2); var common_1 = __webpack_require__(1); var models_1 = __webpack_require__(6); var state_1 = __webpack_require__(0); -var assign = __webpack_require__(7); +var polyfills_1 = __webpack_require__(3); function drawTable(table) { var settings = table.settings; table.cursor = { @@ -1977,8 +1883,8 @@ function modifyRowToFit(row, remainingPageSpace, table) { cell.text = [cell.text]; } var remainderCell = new models_1.Cell(cell.raw, {}, cell.section); - remainderCell = assign(remainderCell, cell); - remainderCell.textPos = assign({}, cell.textPos); + remainderCell = polyfills_1.assign(remainderCell, cell); + remainderCell.textPos = polyfills_1.assign({}, cell.textPos); remainderCell.text = []; var remainingLineCount = getRemainingLineCount(cell, remainingPageSpace); if (cell.text.length > remainingLineCount) { @@ -2161,11 +2067,11 @@ function nextPage(doc) { /***/ }), -/* 17 */ +/* 16 */ /***/ (function(module, exports) { -if(typeof __WEBPACK_EXTERNAL_MODULE__17__ === 'undefined') {var e = new Error("Cannot find module 'undefined'"); e.code = 'MODULE_NOT_FOUND'; throw e;} -module.exports = __WEBPACK_EXTERNAL_MODULE__17__; +if(typeof __WEBPACK_EXTERNAL_MODULE__16__ === 'undefined') {var e = new Error("Cannot find module 'undefined'"); e.code = 'MODULE_NOT_FOUND'; throw e;} +module.exports = __WEBPACK_EXTERNAL_MODULE__16__; /***/ }) /******/ ]); diff --git a/dist/jspdf.plugin.autotable.min.js b/dist/jspdf.plugin.autotable.min.js index 429abafd..7c011f8a 100644 --- a/dist/jspdf.plugin.autotable.min.js +++ b/dist/jspdf.plugin.autotable.min.js @@ -1,15 +1,10 @@ /*! * - * jsPDF AutoTable plugin v3.4.0 + * jsPDF AutoTable plugin v3.4.1 * * Copyright (c) 2020 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable * Licensed under the MIT License. * http://opensource.org/licenses/mit-license * */ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(function(){try{return require("jspdf")}catch(t){}}());else if("function"==typeof define&&define.amd)define(["jspdf"],e);else{var n="object"==typeof exports?e(function(){try{return require("jspdf")}catch(t){}}()):e(t.jsPDF);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=null,i=null;e.globalDefaults={},e.documentDefaults={},e.default=function(){return i},e.getGlobalOptions=function(){return e.globalDefaults},e.getDocumentOptions=function(){return e.documentDefaults};var a=function(){function t(t){this.doc=t}return t.prototype.pageHeight=function(){return this.pageSize().height},t.prototype.pageWidth=function(){return this.pageSize().width},t.prototype.pageSize=function(){var t=this.doc.internal.pageSize;return null==t.width&&(t={width:t.getWidth(),height:t.getHeight()}),t},t.prototype.scaleFactor=function(){return this.doc.internal.scaleFactor},t.prototype.pageNumber=function(){var t=this.doc.internal.getCurrentPageInfo();return t?t.pageNumber:this.doc.internal.getNumberOfPages()},t}();e.setupState=function(t){r=i,i=new a(t),t!==o&&(o=t,e.documentDefaults={})},e.resetState=function(){i=r},e.setDefaults=function(t,n){void 0===n&&(n=null),n?(e.documentDefaults=t||{},o=n):e.globalDefaults=t||{}}},function(t,e,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e0,n=t.fillColor||0===t.fillColor;return e&&n?"DF":e?"S":!!n&&"F"}function u(t){var e=i.default().doc,n={fillColor:e.setFillColor,textColor:e.setTextColor,fontStyle:e.setFontStyle,lineColor:e.setDrawColor,lineWidth:e.setLineWidth,font:e.setFont,fontSize:e.setFontSize};Object.keys(n).forEach((function(e){var r=t[e],o=n[e];void 0!==r&&(Array.isArray(r)?o.apply(this,r):o(r))}))}e.getStringWidth=l,e.ellipsize=function t(e,n,r,o){if(void 0===o&&(o="..."),Array.isArray(e)){var a=[];return e.forEach((function(e,i){a[i]=t(e,n,r,o)})),a}var s=1e4*i.default().scaleFactor();if((n=Math.ceil(n*s)/s)>=l(e,r))return e;for(;n=4?n={top:t[0],right:t[1],bottom:t[2],left:t[3]}:3===t.length?n={top:t[0],right:t[1],bottom:t[2],left:t[1]}:2===t.length?n={top:t[0],right:t[1],bottom:t[0],left:t[1]}:t=1===t.length?t[0]:e;else if("object"==typeof t){t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal);for(var r=0,o=["top","right","bottom","left"];r=1){for(var d=0;d0&&(n||"none"!==s.display))return l._element=e,l}function a(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split("
").map((function(t){return t.trim()})).join("\n"),e.innerText||e.textContent||""}e.parseHtml=function(t,e,n){var r;if(void 0===e&&(e=!1),void 0===n&&(n=!1),r="string"==typeof t?window.document.querySelector(t):t){for(var o=[],a=[],l=[],s=0,u=r.rows;s1})).length>0},t.prototype.canEntireRowFit=function(t){return this.maxCellHeight<=t},t.prototype.getMinimumRowHeight=function(){var t=this;return o.default().table.columns.reduce((function(e,n){var i=t.cells[n.index];if(!i)return 0;var a=i.styles.fontSize/o.default().scaleFactor()*r.FONT_ROW_RATIO,l=i.padding("vertical")+a;return l>e?l:e}),0)},t}();e.Row=d;var c=function(){function t(t,e,n){var r;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.textPos={},this.rowSpan=t&&t.rowSpan||1,this.colSpan=t&&t.colSpan||1,this.styles=l(e,t&&t.styles||{}),this.section=n;var o=t&&null!=t.content?t.content:t;o=o&&null!=o.title?o.title:o,this.raw=t&&t._element?t._element:t,r=null!=o?""+o:"";this.text=r.split(/\r\n|\r|\n/g)}return t.prototype.getContentHeight=function(){return(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/o.default().scaleFactor()*r.FONT_ROW_RATIO)+this.padding("vertical")},t.prototype.padding=function(t){var e=a.marginOrPadding(this.styles.cellPadding,a.styles([]).cellPadding);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},t}();e.Cell=c;var h=function(){function t(t,e,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=n}return t.prototype.getMaxCustomCellWidth=function(){for(var t=0,e=0,n=o.default().table.allRows();e {}}) instead."),t.API.autoTable.globalDefaults||(t.API.autoTable.globalDefaults={}),t.API.autoTable.globalDefaults.addPageContent=e,this},t.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=n(0);function i(t,e){var n=function t(e,n){if(!e)return null;var r=window.getComputedStyle(e)[n];return"rgba(0, 0, 0, 0)"===r||"transparent"===r||"initial"===r||"inherit"===r?t(e.parentElement,n):r}(t,e);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var o=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])];return 0===parseInt(r[4])||isNaN(o[0])||isNaN(o[1])||isNaN(o[2])?null:o}e.parseCss=function(t,e,n){void 0===n&&(n=[]);var a={},l=window.getComputedStyle(t);function s(t,e,r){void 0===r&&(r=[]),0!==r.length&&-1===r.indexOf(e)||-1!==n.indexOf(t)||(0===e||e)&&(a[t]=e)}s("fillColor",i(t,"backgroundColor")),s("fontStyle",function(t){var e="";("bold"===t.fontWeight||"bolder"===t.fontWeight||parseInt(t.fontWeight)>=700)&&(e+="bold");"italic"!==t.fontStyle&&"oblique"!==t.fontStyle||(e+="italic");return e}(l)),s("textColor",i(t,"color")),s("halign",l.textAlign,["left","right","center","justify"]),s("valign",l.verticalAlign,["middle","bottom","top"]),s("fontSize",parseInt(l.fontSize||"")/(96/72)),s("cellPadding",function(t,e,n,o){if(!t)return null;var i=96/(72/o),a=(parseInt(n)-parseInt(e))/o/2,l=t.map((function(t){return parseInt(t)/i}));l=r.marginOrPadding(l,0),a>l.top&&(l.top=a);a>l.bottom&&(l.bottom=a);return l}([l.paddingTop,l.paddingRight,l.paddingBottom,l.paddingLeft],l.fontSize,l.lineHeight,e)),s("lineWidth",parseInt(l.borderTopWidth||"")/(96/72)/e),s("lineColor",i(t,"borderTopColor"));var u=(l.fontFamily||"").toLowerCase();return o.default().doc.getFontList()[u]&&s("font",u),a}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(12),i=n(15),a=n(16),l=n(1);e.default=function(){for(var t=[],e=0;e0?"_"+i:""),n.push(new o.Column(a,a,n.length))}})),n}(e);for(var n=function(n){var r={},i=e[n];if(0===i.length&&e.columns&&"body"!==n){var a=function(t,e){var n={};return t.columns.forEach((function(t){var r=t.raw;if("head"===e){var o=r&&r.header?r.header:r;o&&(n[t.dataKey]=o)}else"foot"===e&&r.footer&&(n[t.dataKey]=r.footer)})),Object.keys(n).length>0?n:null}(t,n);a&&i.push(a)}i.forEach((function(e,i){var a=0,l=new o.Row(e,i,n);t[n].push(l);for(var s=0,u=0,d=0,h=t.columns;di.wrappedWidth&&(i.wrappedWidth=i.minWidth)}}}})),t.allRows().forEach((function(e){for(var n=0,r=t.columns;n1&&!o.minWidth&&(o.minWidth=i.minWidth),i.colSpan>1&&!o.wrappedWidth&&(o.wrappedWidth=i.minWidth))}}))}(h),h.minWidth=h.columns.reduce((function(t,e){return t+e.minWidth}),0),h.wrappedWidth=h.columns.reduce((function(t,e){return t+e.wrappedWidth}),0),"number"==typeof h.settings.tableWidth?h.width=h.settings.tableWidth:"wrap"===h.settings.tableWidth?h.width=h.wrappedWidth:h.width=u.default().pageWidth()-h.margin("left")-h.margin("right"),h}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),a=function(){var t=i.default().table;this.table=t,this.pageNumber=t.pageNumber,this.pageCount=this.pageNumber,this.settings=t.settings,this.cursor=t.cursor,this.doc=i.default().doc};e.HookData=a;var l=function(t){function e(e,n,r){var o=t.call(this)||this;return o.cell=e,o.row=n,o.column=r,o.section=n.section,o}return o(e,t),e}(a);e.CellHookData=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1);function o(t){t.rowHeight?(console.error("Use of deprecated style rowHeight. It is renamed to minCellHeight."),t.minCellHeight||(t.minCellHeight=t.rowHeight)):t.columnWidth&&(console.error("Use of deprecated style columnWidth. It is renamed to cellWidth."),t.cellWidth||(t.cellWidth=t.columnWidth))}e.default=function(t){for(var e=function(t){t&&"object"!=typeof t&&console.error("The options parameter should be of type object, is: "+typeof t),void 0!==t.extendWidth&&(t.tableWidth=t.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),void 0!==t.margins&&(void 0===t.margin&&(t.margin=t.margins),console.error("Use of deprecated option: margins, use margin instead.")),t.startY&&"number"!=typeof t.startY&&(console.error("Invalid value for startY option",t.startY),delete t.startY),!t.didDrawPage&&(t.afterPageContent||t.beforePageContent||t.afterPageAdd)&&(console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead"),t.didDrawPage=function(e){r.applyUserStyles(),t.beforePageContent&&t.beforePageContent(e),r.applyUserStyles(),t.afterPageContent&&t.afterPageContent(e),r.applyUserStyles(),t.afterPageAdd&&e.pageNumber>1&&e.afterPageAdd(e),r.applyUserStyles()}),["createdHeaderCell","drawHeaderRow","drawRow","drawHeaderCell"].forEach((function(e){t[e]&&console.error('The "'+e+'" hook has changed in version 3.0, check the changelog for how to migrate.')})),[["showFoot","showFooter"],["showHead","showHeader"],["didDrawPage","addPageContent"],["didParseCell","createdCell"],["headStyles","headerStyles"]].forEach((function(e){var n=e[0],r=e[1];t[r]&&(console.error("Use of deprecated option "+r+". Use "+n+" instead"),t[n]=t[r])})),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach((function(e){var n="string"==typeof e?e:e[0],r="string"==typeof e?e:e[1];void 0!==t[n]&&(void 0===t.styles[r]&&(t.styles[r]=t[n]),console.error("Use of deprecated option: "+n+", use the style "+r+" instead."))}));for(var e=0,n=["styles","bodyStyles","headStyles","footStyles"];en(t)}));h.length&&(e=i(h,e,n))}return e}e.calculateWidths=function(t){var e=[],n=0;t.columns.forEach((function(t){var r=t.getMaxCustomCellWidth();r?t.width=r:(t.width=t.wrappedWidth,e.push(t)),n+=t.width}));var a=t.width-n;a&&(a=i(e,a,(function(t){return Math.max(t.minReadableWidth,t.minWidth)}))),a&&(a=i(e,a,(function(t){return t.minWidth}))),(a=Math.abs(a))>1e-10&&(a=a<1?a:Math.round(a),console.error("Of the table content, "+a+" units width could not fit page")),function(t){for(var e=t.allRows(),n=0;n1&&t.columns[l+1])i+=s.width,delete r.cells[s.index];else{if(o)u=o,delete r.cells[s.index],o=null;else{if(!(u=r.cells[s.index]))continue;if(a=u.colSpan,i=0,u.colSpan>1){o=u,i+=s.width;continue}}u.width=s.width+i}}}(t),function(t){for(var e={count:0,height:0},n=0,i=t.allRows();nd.contentHeight&&(d.contentHeight=d.styles.minCellHeight);var h=d.contentHeight/d.rowSpan;d.rowSpan>1&&e.count*e.height0&&e.height>h&&(h=e.height),h>a.height&&(a.height=h,a.maxCellHeight=h)}}e.count--}}(t),function(t){for(var e={},n=1,r=t.allRows(),o=0;o1)n--,delete i.cells[s.index];else if(u)u.cell.height+=i.height,u.cell.height>i.maxCellHeight&&(u.row.maxCellHeight=u.cell.height),n=u.cell.colSpan,delete i.cells[s.index],u.left--,u.left<=1&&delete e[s.index];else{var d=i.cells[s.index];if(!d)continue;if(d.height=i.height,d.rowSpan>1){var c=r.length-o,h=d.rowSpan>c?c:d.rowSpan;e[s.index]={cell:d,left:h,row:i}}}}"head"===i.section&&(t.headHeight+=i.maxCellHeight),"foot"===i.section&&(t.footHeight+=i.maxCellHeight),t.height+=i.height}}(t)},e.resizeColumns=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=n(1),i=n(6),a=n(0),l=n(7);function s(t,e){var n=t.styles.fontSize/a.default().scaleFactor()*r.FONT_ROW_RATIO,o=t.padding("vertical"),i=Math.floor((e-o)/n);return Math.max(0,i)}function u(t){var e=a.default().table;e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x;for(var n=0,r=e.columns;na.default().pageHeight())&&(c(a.default().doc),t.cursor.y=t.margin("top")),t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,t.startPageNumber=a.default().pageNumber(),o.applyUserStyles(),!0!==e.showHead&&"firstPage"!==e.showHead&&"everyPage"!==e.showHead||t.head.forEach((function(t){return u(t)})),o.applyUserStyles(),t.body.forEach((function(e,n){!function t(e,n){var r=a.default().table,o=function(t){var e=a.default().table,n=e.margin("bottom"),r=e.settings.showFoot;(!0===r||"everyPage"===r||"lastPage"===r&&t)&&(n+=e.footHeight);return a.default().pageHeight()-e.cursor.y-n}(n);if(e.canEntireRowFit(o))u(e);else if(function(t,e,n){var r=a.default().pageHeight(),o=n.margin("top")+n.margin("bottom"),i=r-o;"body"===t.section&&(i-=n.headHeight+n.footHeight);var l=t.getMinimumRowHeight()i)return console.error("Will not be able to print row "+t.index+" correctly since it's minimum height is larger than page height"),!0;var s=t.hasRowSpan();if(!l)return!1;if(t.maxCellHeight>i)return s&&console.error("The content of row "+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;if(s)return!1;if("avoid"===n.settings.rowPageBreak)return!1;return!0}(e,o,r)){var c=function(t,e,n){var r=new i.Row(t.raw,-1,t.section);r.spansMultiplePages=!0,t.spansMultiplePages=!0,t.height=0,t.maxCellHeight=0;for(var o=0,a=n.columns;oc&&(d.text=g.text.splice(c,g.text.length)),g.contentHeight=g.getContentHeight(),g.contentHeight>t.height&&(t.height=g.contentHeight,t.maxCellHeight=g.contentHeight),d.contentHeight=d.getContentHeight(),d.contentHeight>r.height&&(r.height=d.contentHeight,r.maxCellHeight=d.contentHeight),r.cells[u.index]=d}}for(var h=0,f=n.columns;h0,n=t.fillColor||0===t.fillColor;return e&&n?"DF":e?"S":!!n&&"F"}function u(t,e){void 0===e&&(e=!1);var n=a.default().doc,r={fillColor:n.setFillColor,textColor:n.setTextColor,lineColor:n.setDrawColor,lineWidth:n.setLineWidth},i=o({font:n.setFont,fontSize:n.setFontSize,fontStyle:n.setFontStyle},e?{}:r);Object.keys(i).forEach((function(e){var n=t[e],o=i[e];void 0!==n&&(Array.isArray(n)?o.apply(this,n):o(n))}))}e.getStringWidth=s,e.ellipsize=function t(e,n,o,r){if(void 0===r&&(r="..."),Array.isArray(e))return e.map((function(e){return t(e,n,o,r)}));var i=1e4*a.default().scaleFactor();if((n=Math.ceil(n*i)/i)>=s(e,o))return e;for(;n=4?n={top:t[0],right:t[1],bottom:t[2],left:t[3]}:3===t.length?n={top:t[0],right:t[1],bottom:t[2],left:t[1]}:2===t.length?n={top:t[0],right:t[1],bottom:t[0],left:t[1]}:t=1===t.length?t[0]:e;else if("object"==typeof t){t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal);for(var o=0,r=["top","right","bottom","left"];o=1){for(var u=0;u0&&(n||"none"!==s.display))return l._element=e,l}function a(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split("
").map((function(t){return t.trim()})).join("\n"),e.innerText||e.textContent||""}e.parseHtml=function(t,e,n){var o;void 0===e&&(e=!1),void 0===n&&(n=!1);var r=[],a=[],l=[];if(!(o="string"==typeof t?window.document.querySelector(t):t))return console.error("Html table could not be found with input: ",t),{head:r,body:a,foot:l};for(var s=0,d=o.rows;s1})).length>0},t.prototype.canEntireRowFit=function(t){return this.maxCellHeight<=t},t.prototype.getMinimumRowHeight=function(){var t=this;return r.default().table.columns.reduce((function(e,n){var i=t.cells[n.index];if(!i)return 0;var a=i.styles.fontSize/r.default().scaleFactor()*o.FONT_ROW_RATIO,l=i.padding("vertical")+a;return l>e?l:e}),0)},t}();e.Row=u;var h=function(){function t(t,e,n){var o;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.textPos={},this.rowSpan=t&&t.rowSpan||1,this.colSpan=t&&t.colSpan||1,this.styles=l.assign(e,t&&t.styles||{}),this.section=n;var r=t&&null!=t.content?t.content:t;r=r&&null!=r.title?r.title:r,this.raw=t&&t._element?t._element:t,o=null!=r?""+r:"";this.text=o.split(/\r\n|\r|\n/g)}return t.prototype.getContentHeight=function(){return(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/r.default().scaleFactor()*o.FONT_ROW_RATIO)+this.padding("vertical")},t.prototype.padding=function(t){var e=a.marginOrPadding(this.styles.cellPadding,a.styles([]).cellPadding);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},t}();e.Cell=h;var c=function(){function t(t,e,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=n}return t.prototype.getMaxCustomCellWidth=function(){for(var t=0,e=0,n=r.default().table.allRows();e {}}) instead."),t.API.autoTable.globalDefaults||(t.API.autoTable.globalDefaults={}),t.API.autoTable.globalDefaults.addPageContent=e,this},t.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(0);function i(t,e){var n=function t(e,n){if(!e)return null;var o=window.getComputedStyle(e)[n];return"rgba(0, 0, 0, 0)"===o||"transparent"===o||"initial"===o||"inherit"===o?t(e.parentElement,n):o}(t,e);if(!n)return null;var o=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!o||!Array.isArray(o))return null;var r=[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])];return 0===parseInt(o[4])||isNaN(r[0])||isNaN(r[1])||isNaN(r[2])?null:r}e.parseCss=function(t,e,n){void 0===n&&(n=[]);var a={},l=window.getComputedStyle(t);function s(t,e,o){void 0===o&&(o=[]),0!==o.length&&-1===o.indexOf(e)||-1!==n.indexOf(t)||(0===e||e)&&(a[t]=e)}s("fillColor",i(t,"backgroundColor")),s("fontStyle",function(t){var e="";("bold"===t.fontWeight||"bolder"===t.fontWeight||parseInt(t.fontWeight)>=700)&&(e+="bold");"italic"!==t.fontStyle&&"oblique"!==t.fontStyle||(e+="italic");return e}(l)),s("textColor",i(t,"color")),s("halign",l.textAlign,["left","right","center","justify"]),s("valign",l.verticalAlign,["middle","bottom","top"]),s("fontSize",parseInt(l.fontSize||"")/(96/72)),s("cellPadding",function(t,e,n,r){if(!t)return null;var i=96/(72/r),a=(parseInt(n)-parseInt(e))/r/2,l=t.map((function(t){return parseInt(t)/i}));l=o.marginOrPadding(l,0),a>l.top&&(l.top=a);a>l.bottom&&(l.bottom=a);return l}([l.paddingTop,l.paddingRight,l.paddingBottom,l.paddingLeft],l.fontSize,l.lineHeight,e)),s("lineWidth",parseInt(l.borderTopWidth||"")/(96/72)/e),s("lineColor",i(t,"borderTopColor"));var d=(l.fontFamily||"").toLowerCase();return r.default().doc.getFontList()[d]&&s("font",d),a}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(11),i=n(14),a=n(15),l=n(1);e.default=function(){for(var t=[],e=0;e0?"_"+i:""),n.push(new r.Column(a,a,n.length))}})),n}(e);for(var n=function(n){var o={},i=e[n];if(0===i.length&&e.columns&&"body"!==n){var a=function(t,e){var n={};return t.columns.forEach((function(t){var o=t.raw;if("head"===e){var r=o&&o.header?o.header:o;r&&(n[t.dataKey]=r)}else"foot"===e&&o.footer&&(n[t.dataKey]=o.footer)})),Object.keys(n).length>0?n:null}(t,n);a&&i.push(a)}i.forEach((function(e,i){var a=0,l=new r.Row(e,i,n);t[n].push(l);for(var s=0,d=0,u=0,c=t.columns;ui.wrappedWidth&&(i.wrappedWidth=i.minWidth)}}}})),t.allRows().forEach((function(e){for(var n=0,o=t.columns;n1&&!r.minWidth&&(r.minWidth=i.minWidth),i.colSpan>1&&!r.wrappedWidth&&(r.wrappedWidth=i.minWidth))}}))}(c),c.minWidth=c.columns.reduce((function(t,e){return t+e.minWidth}),0),c.wrappedWidth=c.columns.reduce((function(t,e){return t+e.wrappedWidth}),0),"number"==typeof c.settings.tableWidth?c.width=c.settings.tableWidth:"wrap"===c.settings.tableWidth?c.width=c.wrappedWidth:c.width=d.default().pageWidth()-c.margin("left")-c.margin("right"),c}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),a=function(){var t=i.default().table;this.table=t,this.pageNumber=t.pageNumber,this.pageCount=this.pageNumber,this.settings=t.settings,this.cursor=t.cursor,this.doc=i.default().doc};e.HookData=a;var l=function(t){function e(e,n,o){var r=t.call(this)||this;return r.cell=e,r.row=n,r.column=o,r.section=n.section,r}return r(e,t),e}(a);e.CellHookData=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);function r(t){t.rowHeight?(console.error("Use of deprecated style rowHeight. It is renamed to minCellHeight."),t.minCellHeight||(t.minCellHeight=t.rowHeight)):t.columnWidth&&(console.error("Use of deprecated style columnWidth. It is renamed to cellWidth."),t.cellWidth||(t.cellWidth=t.columnWidth))}e.default=function(t){for(var e=function(t){t&&"object"!=typeof t&&console.error("The options parameter should be of type object, is: "+typeof t),void 0!==t.extendWidth&&(t.tableWidth=t.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),void 0!==t.margins&&(void 0===t.margin&&(t.margin=t.margins),console.error("Use of deprecated option: margins, use margin instead.")),t.startY&&"number"!=typeof t.startY&&(console.error("Invalid value for startY option",t.startY),delete t.startY),!t.didDrawPage&&(t.afterPageContent||t.beforePageContent||t.afterPageAdd)&&(console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead"),t.didDrawPage=function(e){o.applyUserStyles(),t.beforePageContent&&t.beforePageContent(e),o.applyUserStyles(),t.afterPageContent&&t.afterPageContent(e),o.applyUserStyles(),t.afterPageAdd&&e.pageNumber>1&&e.afterPageAdd(e),o.applyUserStyles()}),["createdHeaderCell","drawHeaderRow","drawRow","drawHeaderCell"].forEach((function(e){t[e]&&console.error('The "'+e+'" hook has changed in version 3.0, check the changelog for how to migrate.')})),[["showFoot","showFooter"],["showHead","showHeader"],["didDrawPage","addPageContent"],["didParseCell","createdCell"],["headStyles","headerStyles"]].forEach((function(e){var n=e[0],o=e[1];t[o]&&(console.error("Use of deprecated option "+o+". Use "+n+" instead"),t[n]=t[o])})),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach((function(e){var n="string"==typeof e?e:e[0],o="string"==typeof e?e:e[1];void 0!==t[n]&&(void 0===t.styles[o]&&(t.styles[o]=t[n]),console.error("Use of deprecated option: "+n+", use the style "+o+" instead."))}));for(var e=0,n=["styles","bodyStyles","headStyles","footStyles"];en(t)}));c.length&&(e=i(c,e,n))}return e}e.calculateWidths=function(t){var e=[],n=0;t.columns.forEach((function(t){var o=t.getMaxCustomCellWidth();o?t.width=o:(t.width=t.wrappedWidth,e.push(t)),n+=t.width}));var a=t.width-n;a&&(a=i(e,a,(function(t){return Math.max(t.minReadableWidth,t.minWidth)}))),a&&(a=i(e,a,(function(t){return t.minWidth}))),(a=Math.abs(a))>1e-10&&(a=a<1?a:Math.round(a),console.error("Of the table content, "+a+" units width could not fit page")),function(t){for(var e=t.allRows(),n=0;n1&&t.columns[l+1])i+=s.width,delete o.cells[s.index];else if(r){var d=r;delete o.cells[s.index],r=null,d.width=s.width+i}else{if(!(d=o.cells[s.index]))continue;if(a=d.colSpan,i=0,d.colSpan>1){r=d,i+=s.width;continue}d.width=s.width+i}}}(t),function(t){for(var e={count:0,height:0},n=0,i=t.allRows();nu.contentHeight&&(u.contentHeight=u.styles.minCellHeight);var c=u.contentHeight/u.rowSpan;u.rowSpan>1&&e.count*e.height0&&e.height>c&&(c=e.height),c>a.height&&(a.height=c,a.maxCellHeight=c)}}e.count--}}(t),function(t){for(var e={},n=1,o=t.allRows(),r=0;r1)n--,delete i.cells[s.index];else if(d)d.cell.height+=i.height,d.cell.height>i.maxCellHeight&&(d.row.maxCellHeight=d.cell.height),n=d.cell.colSpan,delete i.cells[s.index],d.left--,d.left<=1&&delete e[s.index];else{var u=i.cells[s.index];if(!u)continue;if(u.height=i.height,u.rowSpan>1){var h=o.length-r,c=u.rowSpan>h?h:u.rowSpan;e[s.index]={cell:u,left:c,row:i}}}}"head"===i.section&&(t.headHeight+=i.maxCellHeight),"foot"===i.section&&(t.footHeight+=i.maxCellHeight),t.height+=i.height}}(t)},e.resizeColumns=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),r=n(1),i=n(6),a=n(0),l=n(3);function s(t,e){var n=t.styles.fontSize/a.default().scaleFactor()*o.FONT_ROW_RATIO,r=t.padding("vertical"),i=Math.floor((e-r)/n);return Math.max(0,i)}function d(t){var e=a.default().table;e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x;for(var n=0,o=e.columns;na.default().pageHeight())&&(h(a.default().doc),t.cursor.y=t.margin("top")),t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,t.startPageNumber=a.default().pageNumber(),r.applyUserStyles(),!0!==e.showHead&&"firstPage"!==e.showHead&&"everyPage"!==e.showHead||t.head.forEach((function(t){return d(t)})),r.applyUserStyles(),t.body.forEach((function(e,n){!function t(e,n){var o=a.default().table,r=function(t){var e=a.default().table,n=e.margin("bottom"),o=e.settings.showFoot;(!0===o||"everyPage"===o||"lastPage"===o&&t)&&(n+=e.footHeight);return a.default().pageHeight()-e.cursor.y-n}(n);if(e.canEntireRowFit(r))d(e);else if(function(t,e,n){var o=a.default().pageHeight(),r=n.margin("top")+n.margin("bottom"),i=o-r;"body"===t.section&&(i-=n.headHeight+n.footHeight);var l=t.getMinimumRowHeight()i)return console.error("Will not be able to print row "+t.index+" correctly since it's minimum height is larger than page height"),!0;var s=t.hasRowSpan();if(!l)return!1;if(t.maxCellHeight>i)return s&&console.error("The content of row "+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;if(s)return!1;if("avoid"===n.settings.rowPageBreak)return!1;return!0}(e,r,o)){var h=function(t,e,n){var o=new i.Row(t.raw,-1,t.section);o.spansMultiplePages=!0,t.spansMultiplePages=!0,t.height=0,t.maxCellHeight=0;for(var r=0,a=n.columns;rh&&(u.text=g.text.splice(h,g.text.length)),g.contentHeight=g.getContentHeight(),g.contentHeight>t.height&&(t.height=g.contentHeight,t.maxCellHeight=g.contentHeight),u.contentHeight=u.getContentHeight(),u.contentHeight>o.height&&(o.height=u.contentHeight,o.maxCellHeight=u.contentHeight),o.cells[d.index]=u}}for(var c=0,f=n.columns;c