/*! * jsPDF AutoTable plugin v2.3.4 * Copyright (c) 2014 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license * * * /if (typeof window === 'object') window.jspdfAutoTableVersion = '2.3.4';/* */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("jspdf")); else if(typeof define === 'function' && define.amd) define(["jspdf"], factory); else { var a = typeof exports === 'object' ? factory(require("jspdf")) : factory(root["jsPDF"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function(__WEBPACK_EXTERNAL_MODULE__19__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 18); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; /** * Ratio between font size and font height. The number comes from jspdf's source code */ exports.FONT_ROW_RATIO = 1.15; var models_1 = __webpack_require__(5); var table = null; var assign = __webpack_require__(6); var entries = __webpack_require__(20); /** * Styles for the themes (overriding the default styles) */ exports.getTheme = function (name) { var themes = { 'striped': { table: { fillColor: 255, textColor: 80, fontStyle: 'normal' }, header: { textColor: 255, fillColor: [41, 128, 185], fontStyle: 'bold' }, body: {}, alternateRow: { fillColor: 245 } }, 'grid': { table: { fillColor: 255, textColor: 80, fontStyle: 'normal', lineWidth: 0.1 }, header: { textColor: 255, fillColor: [26, 188, 156], fontStyle: 'bold', lineWidth: 0 }, body: {}, alternateRow: {} }, 'plain': { header: { fontStyle: 'bold' } } }; return themes[name]; }; function getDefaults() { var scaleFactor = Config.scaleFactor(); return { // Styling theme: 'striped', styles: {}, headerStyles: {}, bodyStyles: {}, alternateRowStyles: {}, columnStyles: {}, // Properties startY: false, margin: 40 / scaleFactor, pageBreak: 'auto', tableWidth: 'auto', showHeader: 'everyPage', tableLineWidth: 0, tableLineColor: 200, // Hooks createdHeaderCell: function (cell, data) { }, createdCell: function (cell, data) { }, drawHeaderRow: function (row, data) { }, drawRow: function (row, data) { }, drawHeaderCell: function (cell, data) { }, drawCell: function (cell, data) { }, addPageContent: function (data) { } }; } exports.getDefaults = getDefaults; // Base style for all themes function defaultStyles() { var scaleFactor = Config.scaleFactor(); return { font: "helvetica", fontStyle: 'normal', overflow: 'ellipsize', fillColor: false, textColor: 20, halign: 'left', valign: 'top', fontSize: 10, cellPadding: 5 / scaleFactor, lineColor: 200, lineWidth: 0 / scaleFactor, columnWidth: 'auto' }; } var Config = /** @class */ (function () { function Config() { } Config.pageSize = function () { var pageSize = table.doc.internal.pageSize; // JSPDF 1.4 uses get functions instead of properties on pageSize if (pageSize.width == null) { pageSize = { width: pageSize.getWidth(), height: pageSize.getHeight() }; } return pageSize; }; Config.applyUserStyles = function () { Config.applyStyles(table.userStyles); }; Config.createTable = function (doc) { table = new models_1.Table(doc); return table; }; Config.tableInstance = function () { return table; }; Config.scaleFactor = function () { return table.doc.internal.scaleFactor; }; Config.hooksData = function (additionalData) { if (additionalData === void 0) { additionalData = {}; } return assign({ pageCount: table.pageCount, settings: table.settings, table: table, doc: table.doc, cursor: table.cursor }, additionalData || {}); }; Config.initSettings = function (table, allOptions) { var _loop_1 = function (styleProp) { var styles = allOptions.map(function (opts) { return opts[styleProp] || {}; }); table.styles[styleProp] = assign.apply(void 0, [{}].concat(styles)); }; // Merge styles one level deeper for (var _i = 0, _a = Object.keys(table.styles); _i < _a.length; _i++) { var styleProp = _a[_i]; _loop_1(styleProp); } // Append event handlers instead of replacing them for (var _b = 0, _c = entries(table.hooks); _b < _c.length; _b++) { var _d = _c[_b], hookName = _d[0], list = _d[1]; for (var _e = 0, allOptions_1 = allOptions; _e < allOptions_1.length; _e++) { var opts = allOptions_1[_e]; if (opts && opts[hookName]) { list.push(opts[hookName]); } } } // Merge all other options one level table.settings = assign.apply(void 0, [getDefaults()].concat(allOptions)); }; // This is messy, only keep array and number format the next major version Config.marginOrPadding = function (value, defaultValue) { var newValue = {}; if (Array.isArray(value)) { if (value.length >= 4) { newValue = { 'top': value[0], 'right': value[1], 'bottom': value[2], 'left': value[3] }; } else if (value.length === 3) { newValue = { 'top': value[0], 'right': value[1], 'bottom': value[2], 'left': value[1] }; } else if (value.length === 2) { newValue = { 'top': value[0], 'right': value[1], 'bottom': value[0], 'left': value[1] }; } else if (value.length === 1) { value = value[0]; } else { value = defaultValue; } } else if (typeof value === 'object') { if (value['vertical']) { value['top'] = value['vertical']; value['bottom'] = value['vertical']; } else if (value['horizontal']) { value['right'] = value['horizontal']; value['left'] = value['horizontal']; } for (var _i = 0, _a = ['top', 'right', 'bottom', 'left']; _i < _a.length; _i++) { var side = _a[_i]; newValue[side] = value[side] || value[side] === 0 ? value[side] : defaultValue; } } if (typeof value === 'number') { newValue = { 'top': value, 'right': value, 'bottom': value, 'left': value }; } return newValue; }; Config.styles = function (styles) { styles = Array.isArray(styles) ? styles : [styles]; return assign.apply(void 0, [defaultStyles()].concat(styles)); }; Config.applyStyles = function (styles) { var doc = table.doc; var styleModifiers = { fillColor: doc.setFillColor, textColor: doc.setTextColor, fontStyle: doc.setFontStyle, lineColor: doc.setDrawColor, lineWidth: doc.setLineWidth, font: doc.setFont, fontSize: doc.setFontSize }; Object.keys(styleModifiers).forEach(function (name) { var style = styles[name]; var modifier = styleModifiers[name]; if (typeof style !== 'undefined') { if (Array.isArray(style)) { modifier.apply(this, style); } else { modifier(style); } } }); }; return Config; }()); exports.Config = Config; /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__(2); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(27); module.exports = Function.prototype.bind || implementation; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fnToStr = Function.prototype.toString; var constructorRegex = /^\s*class\b/; var isES6ClassFn = function isES6ClassFunction(value) { try { var fnStr = fnToStr.call(value); return constructorRegex.test(fnStr); } catch (e) { return false; // not a function } }; var tryFunctionObject = function tryFunctionToStr(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var fnClass = '[object Function]'; var genClass = '[object GeneratorFunction]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (typeof value === 'function' && !value.prototype) { return true; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = toStr.call(value); return strClass === fnClass || strClass === genClass; }; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var config_1 = __webpack_require__(0); var painter_1 = __webpack_require__(17); function getStringWidth(text, styles) { var k = config_1.Config.scaleFactor(); var fontSize = styles.fontSize / k; config_1.Config.applyStyles(styles); text = Array.isArray(text) ? text : [text]; var maxWidth = 0; text.forEach(function (line) { var width = config_1.Config.tableInstance().doc.getStringUnitWidth(line); if (width > maxWidth) { maxWidth = width; } }); var precision = 10000 * k; maxWidth = Math.floor(maxWidth * precision) / precision; return maxWidth * fontSize; } exports.getStringWidth = getStringWidth; /** * Ellipsize the text to fit in the width */ 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; } var precision = 10000 * config_1.Config.scaleFactor(); width = Math.ceil(width * precision) / precision; if (width >= getStringWidth(text, styles)) { return text; } while (width < getStringWidth(text + ellipsizeStr, styles)) { if (text.length <= 1) { break; } text = text.substring(0, text.length - 1); } return text.trim() + ellipsizeStr; } exports.ellipsize = ellipsize; function addTableBorder() { var table = config_1.Config.tableInstance(); var styles = { lineWidth: table.settings.tableLineWidth, lineColor: table.settings.tableLineColor }; config_1.Config.applyStyles(styles); var fs = getFillStyle(styles); if (fs) { table.doc.rect(table.pageStartX, table.pageStartY, table.width, table.cursor.y - table.pageStartY, fs); } } exports.addTableBorder = addTableBorder; function addPage() { var table = config_1.Config.tableInstance(); table.finalY = table.cursor.y; // Add user content just before adding new page ensure it will // be drawn above other things on the page addContentHooks(); addTableBorder(); nextPage(table.doc); table.pageCount++; table.cursor = { x: table.margin('left'), y: table.margin('top') }; table.pageStartX = table.cursor.x; table.pageStartY = table.cursor.y; if (table.settings.showHeader === true || table.settings.showHeader === 'everyPage') { painter_1.printRow(table.headerRow, table.hooks.drawHeaderRow, table.hooks.drawHeaderCell); } } exports.addPage = addPage; function addContentHooks() { for (var _i = 0, _a = config_1.Config.tableInstance().hooks.addPageContent; _i < _a.length; _i++) { var hook = _a[_i]; config_1.Config.applyUserStyles(); hook(config_1.Config.hooksData()); } config_1.Config.applyUserStyles(); } exports.addContentHooks = addContentHooks; function getFillStyle(styles) { var drawLine = styles.lineWidth > 0; var drawBackground = styles.fillColor || styles.fillColor === 0; if (drawLine && drawBackground) { return 'DF'; // Fill then stroke } else if (drawLine) { return 'S'; // Only stroke (transparent background) } else if (drawBackground) { return 'F'; // Only fill, no stroke } else { return false; } } exports.getFillStyle = getFillStyle; function nextPage(doc) { var current = doc.internal.getCurrentPageInfo().pageNumber; doc.setPage(current + 1); var newCurrent = doc.internal.getCurrentPageInfo().pageNumber; if (newCurrent === current) { doc.addPage(); } } exports.nextPage = nextPage; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var config_1 = __webpack_require__(0); exports.table = {}; var Table = /** @class */ (function () { function Table(doc) { this.height = 0; this.width = 0; this.contentWidth = 0; this.preferredWidth = 0; this.rows = []; this.columns = []; this.headerRow = null; this.pageCount = 1; this.hooks = { createdHeaderCell: [], createdCell: [], drawHeaderRow: [], drawRow: [], drawHeaderCell: [], drawCell: [], addPageContent: [] }; this.styles = { styles: {}, headerStyles: {}, bodyStyles: {}, alternateRowStyles: {}, columnStyles: {} }; this.doc = doc; this.userStyles = { textColor: 30, fontSize: doc.internal.getFontSize(), fontStyle: doc.internal.getFont().fontStyle }; } Table.prototype.margin = function (side) { return config_1.Config.marginOrPadding(this.settings.margin, config_1.getDefaults().margin)[side]; }; return Table; }()); exports.Table = Table; var Row = /** @class */ (function () { function Row(raw, index) { this.cells = {}; this.spansMultiplePages = false; this.pageCount = 1; this.height = 0; this.y = 0; this.maxLineCount = 1; this.raw = raw; this.index = index; } return Row; }()); exports.Row = Row; var Cell = /** @class */ (function () { function Cell(raw) { this.styles = {}; this.text = ''; this.contentWidth = 0; this.textPos = {}; this.height = 0; this.width = 0; this.x = 0; this.y = 0; this.raw = raw; } Cell.prototype.padding = function (name) { var padding = config_1.Config.marginOrPadding(this.styles.cellPadding, config_1.Config.styles([]).cellPadding); if (name === 'vertical') { return padding.top + padding.bottom; } else if (name === 'horizontal') { return padding.left + padding.right; } else { return padding[name]; } }; return Cell; }()); exports.Cell = Cell; var Column = /** @class */ (function () { function Column(dataKey, index) { this.options = {}; this.contentWidth = 0; this.preferredWidth = 0; this.widthStyle = 'auto'; this.width = 0; this.x = 0; this.dataKey = dataKey; this.index = index; } return Column; }()); exports.Column = Column; /***/ }), /* 6 */ /***/ (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; }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var keys = __webpack_require__(21); var foreach = __webpack_require__(23); var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; var toStr = Object.prototype.toString; var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var arePropertyDescriptorsSupported = function () { var obj = {}; try { Object.defineProperty(obj, 'x', { enumerable: false, value: obj }); /* eslint-disable no-unused-vars, no-restricted-syntax */ for (var _ in obj) { return false; } /* eslint-enable no-unused-vars, no-restricted-syntax */ return obj.x === obj; } catch (e) { /* this is IE 8. */ return false; } }; var supportsDescriptors = Object.defineProperty && arePropertyDescriptorsSupported(); var defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return; } if (supportsDescriptors) { Object.defineProperty(object, name, { configurable: true, enumerable: false, value: value, writable: true }); } else { object[name] = value; } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = props.concat(Object.getOwnPropertySymbols(map)); } foreach(props, function (name) { defineProperty(object, name, map[name], predicates[name]); }); }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ES = __webpack_require__(24); var has = __webpack_require__(1); var bind = __webpack_require__(2); var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); module.exports = function entries(O) { var obj = ES.RequireObjectCoercible(O); var entrys = []; for (var key in obj) { if (has(obj, key) && isEnumerable(obj, key)) { entrys.push([key, obj[key]]); } } return entrys; }; /***/ }), /* 9 */ /***/ (function(module, exports) { module.exports = function isPrimitive(value) { return value === null || (typeof value !== 'function' && typeof value !== 'object'); }; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* globals Set, Map, WeakSet, WeakMap, Promise, Symbol, Proxy, Atomics, SharedArrayBuffer, ArrayBuffer, DataView, Uint8Array, Float32Array, Float64Array, Int8Array, Int16Array, Int32Array, Uint8ClampedArray, Uint16Array, Uint32Array, */ var undefined; // eslint-disable-line no-shadow-restricted-names var ThrowTypeError = Object.getOwnPropertyDescriptor ? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }()) : function () { throw new TypeError(); }; var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto var generator; // = function * () {}; var generatorFunction = generator ? getProto(generator) : undefined; var asyncFn; // async function() {}; var asyncFunction = asyncFn ? asyncFn.constructor : undefined; var asyncGen; // async function * () {}; var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; var asyncGenIterator = asyncGen ? asyncGen() : undefined; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '$ %Array%': Array, '$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, '$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '$ %ArrayPrototype%': Array.prototype, '$ %ArrayProto_entries%': Array.prototype.entries, '$ %ArrayProto_forEach%': Array.prototype.forEach, '$ %ArrayProto_keys%': Array.prototype.keys, '$ %ArrayProto_values%': Array.prototype.values, '$ %AsyncFromSyncIteratorPrototype%': undefined, '$ %AsyncFunction%': asyncFunction, '$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, '$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, '$ %AsyncGeneratorFunction%': asyncGenFunction, '$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, '$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, '$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '$ %Boolean%': Boolean, '$ %BooleanPrototype%': Boolean.prototype, '$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView, '$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, '$ %Date%': Date, '$ %DatePrototype%': Date.prototype, '$ %decodeURI%': decodeURI, '$ %decodeURIComponent%': decodeURIComponent, '$ %encodeURI%': encodeURI, '$ %encodeURIComponent%': encodeURIComponent, '$ %Error%': Error, '$ %ErrorPrototype%': Error.prototype, '$ %eval%': eval, // eslint-disable-line no-eval '$ %EvalError%': EvalError, '$ %EvalErrorPrototype%': EvalError.prototype, '$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, '$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, '$ %Function%': Function, '$ %FunctionPrototype%': Function.prototype, '$ %Generator%': generator ? getProto(generator()) : undefined, '$ %GeneratorFunction%': generatorFunction, '$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, '$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, '$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, '$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, '$ %isFinite%': isFinite, '$ %isNaN%': isNaN, '$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '$ %JSON%': JSON, '$ %JSONParse%': JSON.parse, '$ %Map%': typeof Map === 'undefined' ? undefined : Map, '$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, '$ %Math%': Math, '$ %Number%': Number, '$ %NumberPrototype%': Number.prototype, '$ %Object%': Object, '$ %ObjectPrototype%': Object.prototype, '$ %ObjProto_toString%': Object.prototype.toString, '$ %ObjProto_valueOf%': Object.prototype.valueOf, '$ %parseFloat%': parseFloat, '$ %parseInt%': parseInt, '$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise, '$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, '$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, '$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, '$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, '$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, '$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '$ %RangeError%': RangeError, '$ %RangeErrorPrototype%': RangeError.prototype, '$ %ReferenceError%': ReferenceError, '$ %ReferenceErrorPrototype%': ReferenceError.prototype, '$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '$ %RegExp%': RegExp, '$ %RegExpPrototype%': RegExp.prototype, '$ %Set%': typeof Set === 'undefined' ? undefined : Set, '$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, '$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, '$ %String%': String, '$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '$ %StringPrototype%': String.prototype, '$ %Symbol%': hasSymbols ? Symbol : undefined, '$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, '$ %SyntaxError%': SyntaxError, '$ %SyntaxErrorPrototype%': SyntaxError.prototype, '$ %ThrowTypeError%': ThrowTypeError, '$ %TypedArray%': TypedArray, '$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, '$ %TypeError%': TypeError, '$ %TypeErrorPrototype%': TypeError.prototype, '$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, '$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, '$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, '$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, '$ %URIError%': URIError, '$ %URIErrorPrototype%': URIError.prototype, '$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, '$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, '$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype }; module.exports = function GetIntrinsic(name, allowMissing) { if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new TypeError('"allowMissing" argument must be a boolean'); } var key = '$ ' + name; if (!(key in INTRINSICS)) { throw new SyntaxError('intrinsic ' + name + ' does not exist!'); } // istanbul ignore if // hopefully this is impossible to test :-) if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) { throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return INTRINSICS[key]; }; /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = Number.isNaN || function isNaN(a) { return a !== a; }; /***/ }), /* 12 */ /***/ (function(module, exports) { var $isNaN = Number.isNaN || function (a) { return a !== a; }; module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { var bind = __webpack_require__(2); var has = bind.call(Function.call, Object.prototype.hasOwnProperty); var $assign = Object.assign; module.exports = function assign(target, source) { if ($assign) { return $assign(target, source); } for (var key in source) { if (has(source, key)) { target[key] = source[key]; } } return target; }; /***/ }), /* 14 */ /***/ (function(module, exports) { module.exports = function sign(number) { return number >= 0 ? 1 : -1; }; /***/ }), /* 15 */ /***/ (function(module, exports) { module.exports = function mod(number, modulo) { var remain = number % modulo; return Math.floor(remain >= 0 ? remain : remain + modulo); }; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(8); module.exports = function getPolyfill() { return typeof Object.entries === 'function' ? Object.entries : implementation; }; /***/ }), /* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var config_1 = __webpack_require__(0); var common_1 = __webpack_require__(4); function printFullRow(row, drawRowHooks, drawCellHooks) { var remainingRowHeight = 0; var remainingTexts = {}; var table = config_1.Config.tableInstance(); if (!canFitOnPage(row.height)) { if (row.maxLineCount <= 1) { common_1.addPage(); } else { // Modify the row to fit the current page and calculate text and height of partial row row.spansMultiplePages = true; var pageHeight = config_1.Config.pageSize().height; var maxCellHeight = 0; for (var j = 0; j < table.columns.length; j++) { var col = table.columns[j]; var cell = row.cells[col.dataKey]; var fontHeight = cell.styles.fontSize / config_1.Config.scaleFactor() * config_1.FONT_ROW_RATIO; var vPadding = cell.padding('vertical'); var remainingPageSpace = pageHeight - table.cursor.y - table.margin('bottom'); var remainingLineCount = Math.floor((remainingPageSpace - vPadding) / fontHeight); // Splice with negative values results in unexpected results, therefore eliminate // scenarios where less than one line is remaining, but are shown if (remainingLineCount < 0) { remainingLineCount = 0; } if (Array.isArray(cell.text) && cell.text.length > remainingLineCount) { var remainingLines = cell.text.splice(remainingLineCount, cell.text.length); remainingTexts[col.dataKey] = remainingLines; var cellHeight = cell.text.length * fontHeight + vPadding; if (cellHeight > maxCellHeight) { maxCellHeight = cellHeight; } var rCellHeight = remainingLines.length * fontHeight + vPadding; if (rCellHeight > remainingRowHeight) { remainingRowHeight = rCellHeight; } } } // Reset row height since text are now removed row.height = maxCellHeight; } } printRow(row, drawRowHooks, drawCellHooks); // Parts of the row is now printed. Time for adding a new page, prune // the text and start over if (Object.keys(remainingTexts).length > 0) { for (var j = 0; j < table.columns.length; j++) { var col = table.columns[j]; var cell = row.cells[col.dataKey]; cell.text = remainingTexts[col.dataKey] || ''; } common_1.addPage(); row.pageCount++; row.height = remainingRowHeight; printFullRow(row, drawRowHooks, drawCellHooks); } } exports.printFullRow = printFullRow; function printRow(row, drawRowHooks, drawCellHooks) { var table = config_1.Config.tableInstance(); row.y = table.cursor.y; for (var _i = 0, drawRowHooks_1 = drawRowHooks; _i < drawRowHooks_1.length; _i++) { var hook = drawRowHooks_1[_i]; if (hook(row, config_1.Config.hooksData({ row: row, addPage: common_1.addPage })) === false) { return; } } table.cursor.x = table.margin('left'); for (var i = 0; i < table.columns.length; i++) { var column = table.columns[i]; var cell = row.cells[column.dataKey]; if (!cell) { continue; } config_1.Config.applyStyles(cell.styles); cell.x = table.cursor.x; cell.y = table.cursor.y; cell.height = row.height; cell.width = column.width; if (cell.styles.valign === 'top') { cell.textPos.y = table.cursor.y + cell.padding('top'); } else if (cell.styles.valign === 'bottom') { cell.textPos.y = table.cursor.y + row.height - cell.padding('bottom'); } else { cell.textPos.y = table.cursor.y + row.height / 2; } if (cell.styles.halign === 'right') { cell.textPos.x = cell.x + cell.width - cell.padding('right'); } else if (cell.styles.halign === 'center') { cell.textPos.x = cell.x + cell.width / 2; } else { cell.textPos.x = cell.x + cell.padding('left'); } var shouldDrawCell = true; var data = config_1.Config.hooksData({ column: column, row: row, addPage: common_1.addPage }); for (var _a = 0, drawCellHooks_1 = drawCellHooks; _a < drawCellHooks_1.length; _a++) { var hook = drawCellHooks_1[_a]; if (hook(cell, data) === false) { shouldDrawCell = false; } } if (shouldDrawCell) { var fillStyle = common_1.getFillStyle(cell.styles); if (fillStyle) { table.doc.rect(cell.x, cell.y, cell.width, cell.height, fillStyle); } table.doc.autoTableText(cell.text, cell.textPos.x, cell.textPos.y, { halign: cell.styles.halign, valign: cell.styles.valign }); } table.cursor.x += cell.width; } table.cursor.y += row.height; } exports.printRow = printRow; function canFitOnPage(rowHeight) { var table = config_1.Config.tableInstance(); var pos = rowHeight + table.cursor.y + table.margin('bottom'); return pos < config_1.Config.pageSize().height; } /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var jsPDF = __webpack_require__(19); var config_1 = __webpack_require__(0); var common_1 = __webpack_require__(4); var painter_1 = __webpack_require__(17); var calculator_1 = __webpack_require__(36); var creator_1 = __webpack_require__(37); /** * Create a table from a set of rows and columns. * * @param {Object[]|String[]} headers Either as an array of objects or array of strings * @param {Object[][]|String[][]} data Either as an array of objects or array of strings * @param {Object} [tableOptions={}] Options that will override the default ones */ jsPDF.API.autoTable = function (headers, data, tableOptions) { if (tableOptions === void 0) { tableOptions = {}; } this.autoTableState = this.autoTableState || {}; jsPDF.autoTableState = jsPDF.autoTableState || {}; var allOptions = [jsPDF.autoTableState.defaults || {}, this.autoTableState.defaults || {}, tableOptions || {}]; creator_1.validateInput(headers, data, allOptions); var table = config_1.Config.createTable(this); config_1.Config.initSettings(table, allOptions); var settings = table.settings; // Create the table model with its columns, rows and cells creator_1.createModels(headers, data); settings.margin = config_1.Config.marginOrPadding(settings.margin, config_1.getDefaults().margin); calculator_1.calculateWidths(this, config_1.Config.pageSize().width); table.cursor = { x: table.margin('left'), y: settings.startY === false ? table.margin('top') : settings.startY }; var minTableBottomPos = settings.startY + table.margin('bottom') + table.headerRow.height; if (settings.pageBreak === 'avoid') { minTableBottomPos += table.height; } var pageHeight = config_1.Config.pageSize().height; if ((settings.pageBreak === 'always' && settings.startY !== false) || (settings.startY !== false && minTableBottomPos > pageHeight)) { common_1.nextPage(table.doc); table.cursor.y = table.margin('top'); } table.pageStartX = table.cursor.x; table.pageStartY = table.cursor.y; config_1.Config.applyUserStyles(); if (settings.showHeader === true || settings.showHeader === 'firstPage' || settings.showHeader === 'everyPage') { painter_1.printRow(table.headerRow, table.hooks.drawHeaderRow, table.hooks.drawHeaderCell); } config_1.Config.applyUserStyles(); table.rows.forEach(function (row) { painter_1.printFullRow(row, table.hooks.drawRow, table.hooks.drawCell); }); common_1.addTableBorder(); // Don't call global and document addPageContent more than once for each page var pageNumber = this.internal.getCurrentPageInfo().pageNumber; if (this.autoTableState.addPageHookPages && this.autoTableState.addPageHookPages[pageNumber]) { if (typeof tableOptions['addPageContent'] === 'function') { tableOptions['addPageContent'](config_1.Config.hooksData()); } } else { if (!this.autoTableState.addPageHookPages) this.autoTableState.addPageHookPages = {}; this.autoTableState.addPageHookPages[pageNumber] = true; common_1.addContentHooks(); } table.finalY = table.cursor.y; this.autoTable.previous = table; config_1.Config.applyUserStyles(); return this; }; // Enables doc.autoTable.previous.finalY || 40; jsPDF.API.autoTable.previous = false; jsPDF.API.autoTableSetDefaults = function (defaults) { if (!this.autoTableState) this.autoTableState = {}; if (defaults && typeof defaults === 'object') { this.autoTableState.defaults = defaults; } else { delete this.autoTableState.defaults; } return this; }; jsPDF.autoTableSetDefaults = function (defaults) { if (!jsPDF.autoTableState) jsPDF.autoTableState = {}; if (defaults && typeof defaults === 'object') { this.autoTableState.defaults = defaults; } else { delete this.autoTableState.defaults; } jsPDF.autoTableState.defaults = defaults; }; /** * Parses an html table * * @param tableElem Html table element * @param includeHiddenElements If to include hidden rows and columns (defaults to false) * @returns Object Object with two properties, columns and rows */ jsPDF.API.autoTableHtmlToJson = function (tableElem, includeHiddenElements) { includeHiddenElements = includeHiddenElements || false; if (!tableElem || !(tableElem instanceof HTMLTableElement)) { console.error("A HTMLTableElement has to be sent to autoTableHtmlToJson"); return null; } var columns = {}, rows = []; var header = tableElem.rows[0]; for (var i = 0; i < header.cells.length; i++) { var cell = header.cells[i]; var style = window.getComputedStyle(cell); if (includeHiddenElements || style.display !== 'none') { columns[i] = cell; } } var _loop_1 = function (i) { var tableRow = tableElem.rows[i]; var style = window.getComputedStyle(tableRow); if (includeHiddenElements || style.display !== 'none') { var rowData_1 = []; Object.keys(columns).forEach(function (key) { var cell = tableRow.cells[key]; rowData_1.push(cell); }); rows.push(rowData_1); } }; for (var i = 1; i < tableElem.rows.length; i++) { _loop_1(i); } var values = Object.keys(columns).map(function (key) { return columns[key]; }); return { columns: values, rows: rows, data: rows }; }; /** * Improved text function with halign and valign support * Inspiration from: http://stackoverflow.com/questions/28327510/align-text-right-using-jspdf/28433113#28433113 */ jsPDF.API.autoTableText = function (text, x, y, styles) { if (typeof x !== 'number' || typeof y !== 'number') { console.error('The x and y parameters are required. Missing for the text: ', text); } var k = this.internal.scaleFactor; var fontSize = this.internal.getFontSize() / k; var splitRegex = /\r\n|\r|\n/g; var splitText = null; var lineCount = 1; if (styles.valign === 'middle' || styles.valign === 'bottom' || styles.halign === 'center' || styles.halign === 'right') { splitText = typeof text === 'string' ? text.split(splitRegex) : text; lineCount = splitText.length || 1; } // Align the top y += fontSize * (2 - config_1.FONT_ROW_RATIO); if (styles.valign === 'middle') y -= (lineCount / 2) * fontSize * config_1.FONT_ROW_RATIO; else if (styles.valign === 'bottom') y -= lineCount * fontSize * config_1.FONT_ROW_RATIO; if (styles.halign === 'center' || styles.halign === 'right') { var alignSize = fontSize; if (styles.halign === 'center') alignSize *= 0.5; if (lineCount >= 1) { for (var iLine = 0; iLine < splitText.length; iLine++) { this.text(splitText[iLine], x - this.getStringUnitWidth(splitText[iLine]) * alignSize, y); y += fontSize; } return this; } x -= this.getStringUnitWidth(text) * alignSize; } this.text(text, x, y); return this; }; /** * @deprecated Use doc.autoTable.previous.finalY instead */ jsPDF.API.autoTableEndPosY = function () { var prev = this.autoTable.previous; if (prev.cursor && typeof prev.cursor.y === 'number') { return prev.cursor.y; } else { return 0; } }; /** * @deprecated Use jsPDF.autoTableSetDefaults({addPageContent: function() {}}) instead */ jsPDF.API.autoTableAddPageContent = function (hook) { if (!jsPDF.API.autoTable.globalDefaults) { jsPDF.API.autoTable.globalDefaults = {}; } jsPDF.API.autoTable.globalDefaults.addPageContent = hook; return this; }; /** * @deprecated Use data.addPage in hooks instead */ jsPDF.API.autoTableAddPage = function () { common_1.addPage(); return this; }; /***/ }), /* 19 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__19__; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var define = __webpack_require__(7); var implementation = __webpack_require__(8); var getPolyfill = __webpack_require__(16); var shim = __webpack_require__(35); var polyfill = getPolyfill(); define(polyfill, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = polyfill; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // modified from https://github.com/es-shims/es5-shim var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var slice = Array.prototype.slice; var isArgs = __webpack_require__(22); var isEnumerable = Object.prototype.propertyIsEnumerable; var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); var dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; var equalsConstructorPrototype = function (o) { var ctor = o.constructor; return ctor && ctor.prototype === o; }; var excludedKeys = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true }; var hasAutomationEqualityBug = (function () { /* global window */ if (typeof window === 'undefined') { return false; } for (var k in window) { try { if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { try { equalsConstructorPrototype(window[k]); } catch (e) { return true; } } } catch (e) { return true; } } return false; }()); var equalsConstructorPrototypeIfNotBuggy = function (o) { /* global window */ if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(o); } try { return equalsConstructorPrototype(o); } catch (e) { return false; } }; var keysShim = function keys(object) { var isObject = object !== null && typeof object === 'object'; var isFunction = toStr.call(object) === '[object Function]'; var isArguments = isArgs(object); var isString = isObject && toStr.call(object) === '[object String]'; var theKeys = []; if (!isObject && !isFunction && !isArguments) { throw new TypeError('Object.keys called on a non-object'); } var skipProto = hasProtoEnumBug && isFunction; if (isString && object.length > 0 && !has.call(object, 0)) { for (var i = 0; i < object.length; ++i) { theKeys.push(String(i)); } } if (isArguments && object.length > 0) { for (var j = 0; j < object.length; ++j) { theKeys.push(String(j)); } } else { for (var name in object) { if (!(skipProto && name === 'prototype') && has.call(object, name)) { theKeys.push(String(name)); } } } if (hasDontEnumBug) { var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); for (var k = 0; k < dontEnums.length; ++k) { if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { theKeys.push(dontEnums[k]); } } } return theKeys; }; keysShim.shim = function shimObjectKeys() { if (Object.keys) { var keysWorksWithArguments = (function () { // Safari 5.0 bug return (Object.keys(arguments) || '').length === 2; }(1, 2)); if (!keysWorksWithArguments) { var originalKeys = Object.keys; Object.keys = function keys(object) { // eslint-disable-line func-name-matching if (isArgs(object)) { return originalKeys(slice.call(object)); } else { return originalKeys(object); } }; } } else { Object.keys = keysShim; } return Object.keys || keysShim; }; module.exports = keysShim; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toStr = Object.prototype.toString; module.exports = function isArguments(value) { var str = toStr.call(value); var isArgs = str === '[object Arguments]'; if (!isArgs) { isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]'; } return isArgs; }; /***/ }), /* 23 */ /***/ (function(module, exports) { var hasOwn = Object.prototype.hasOwnProperty; var toString = Object.prototype.toString; module.exports = function forEach (obj, fn, ctx) { if (toString.call(fn) !== '[object Function]') { throw new TypeError('iterator must be a function'); } var l = obj.length; if (l === +l) { for (var i = 0; i < l; i++) { fn.call(ctx, obj[i], i, obj); } } else { for (var k in obj) { if (hasOwn.call(obj, k)) { fn.call(ctx, obj[k], k, obj); } } } }; /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(25); /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ES2015 = __webpack_require__(26); var assign = __webpack_require__(13); var ES2016 = assign(assign({}, ES2015), { // https://github.com/tc39/ecma262/pull/60 SameValueNonNumber: function SameValueNonNumber(x, y) { if (typeof x === 'number' || typeof x !== typeof y) { throw new TypeError('SameValueNonNumber requires two non-number values of the same type.'); } return this.SameValue(x, y); } }); module.exports = ES2016; /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = __webpack_require__(1); var toPrimitive = __webpack_require__(28); var GetIntrinsic = __webpack_require__(10); var $TypeError = GetIntrinsic('%TypeError%'); var $SyntaxError = GetIntrinsic('%SyntaxError%'); var $Array = GetIntrinsic('%Array%'); var $String = GetIntrinsic('%String%'); var $Object = GetIntrinsic('%Object%'); var $Number = GetIntrinsic('%Number%'); var $Symbol = GetIntrinsic('%Symbol%', true); var $RegExp = GetIntrinsic('%RegExp%'); var hasSymbols = !!$Symbol; var $isNaN = __webpack_require__(11); var $isFinite = __webpack_require__(12); var MAX_SAFE_INTEGER = $Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; var assign = __webpack_require__(13); var sign = __webpack_require__(14); var mod = __webpack_require__(15); var isPrimitive = __webpack_require__(31); var parseInteger = parseInt; var bind = __webpack_require__(2); var arraySlice = bind.call(Function.call, $Array.prototype.slice); var strSlice = bind.call(Function.call, $String.prototype.slice); var isBinary = bind.call(Function.call, $RegExp.prototype.test, /^0b[01]+$/i); var isOctal = bind.call(Function.call, $RegExp.prototype.test, /^0o[0-7]+$/i); var regexExec = bind.call(Function.call, $RegExp.prototype.exec); var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); var hasNonWS = bind.call(Function.call, $RegExp.prototype.test, nonWSregex); var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i; var isInvalidHexLiteral = bind.call(Function.call, $RegExp.prototype.test, invalidHexLiteral); var $charCodeAt = bind.call(Function.call, $String.prototype.charCodeAt); var toStr = bind.call(Function.call, Object.prototype.toString); var $floor = Math.floor; var $abs = Math.abs; var $ObjectCreate = Object.create; var $gOPD = $Object.getOwnPropertyDescriptor; var $isExtensible = $Object.isExtensible; // whitespace from: http://es5.github.io/#x15.5.4.20 // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 var ws = [ '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', '\u2029\uFEFF' ].join(''); var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); var replace = bind.call(Function.call, $String.prototype.replace); var trim = function (value) { return replace(value, trimRegex, ''); }; var ES5 = __webpack_require__(32); var hasRegExpMatcher = __webpack_require__(34); // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations var ES6 = assign(assign({}, ES5), { // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args Call: function Call(F, V) { var args = arguments.length > 2 ? arguments[2] : []; if (!this.IsCallable(F)) { throw new $TypeError(F + ' is not a function'); } return F.apply(V, args); }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive ToPrimitive: toPrimitive, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean // ToBoolean: ES5.ToBoolean, // https://ecma-international.org/ecma-262/6.0/#sec-tonumber ToNumber: function ToNumber(argument) { var value = isPrimitive(argument) ? argument : toPrimitive(argument, $Number); if (typeof value === 'symbol') { throw new $TypeError('Cannot convert a Symbol value to a number'); } if (typeof value === 'string') { if (isBinary(value)) { return this.ToNumber(parseInteger(strSlice(value, 2), 2)); } else if (isOctal(value)) { return this.ToNumber(parseInteger(strSlice(value, 2), 8)); } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { return NaN; } else { var trimmed = trim(value); if (trimmed !== value) { return this.ToNumber(trimmed); } } } return $Number(value); }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger // ToInteger: ES5.ToNumber, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32 // ToInt32: ES5.ToInt32, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32 // ToUint32: ES5.ToUint32, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16 ToInt16: function ToInt16(argument) { var int16bit = this.ToUint16(argument); return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16 // ToUint16: ES5.ToUint16, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8 ToInt8: function ToInt8(argument) { var int8bit = this.ToUint8(argument); return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8 ToUint8: function ToUint8(argument) { var number = this.ToNumber(argument); if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } var posInt = sign(number) * $floor($abs(number)); return mod(posInt, 0x100); }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp ToUint8Clamp: function ToUint8Clamp(argument) { var number = this.ToNumber(argument); if ($isNaN(number) || number <= 0) { return 0; } if (number >= 0xFF) { return 0xFF; } var f = $floor(argument); if (f + 0.5 < number) { return f + 1; } if (number < f + 0.5) { return f; } if (f % 2 !== 0) { return f + 1; } return f; }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring ToString: function ToString(argument) { if (typeof argument === 'symbol') { throw new $TypeError('Cannot convert a Symbol value to a string'); } return $String(argument); }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject ToObject: function ToObject(value) { this.RequireObjectCoercible(value); return $Object(value); }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey ToPropertyKey: function ToPropertyKey(argument) { var key = this.ToPrimitive(argument, $String); return typeof key === 'symbol' ? key : this.ToString(key); }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength ToLength: function ToLength(argument) { var len = this.ToInteger(argument); if (len <= 0) { return 0; } // includes converting -0 to +0 if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } return len; }, // https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) { if (toStr(argument) !== '[object String]') { throw new $TypeError('must be a string'); } if (argument === '-0') { return -0; } var n = this.ToNumber(argument); if (this.SameValue(this.ToString(n), argument)) { return n; } return void 0; }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible RequireObjectCoercible: ES5.CheckObjectCoercible, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray IsArray: $Array.isArray || function IsArray(argument) { return toStr(argument) === '[object Array]'; }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable // IsCallable: ES5.IsCallable, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor IsConstructor: function IsConstructor(argument) { return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument` }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o IsExtensible: Object.preventExtensions ? function IsExtensible(obj) { if (isPrimitive(obj)) { return false; } return $isExtensible(obj); } : function isExtensible(obj) { return true; }, // eslint-disable-line no-unused-vars // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger IsInteger: function IsInteger(argument) { if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { return false; } var abs = $abs(argument); return $floor(abs) === abs; }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey IsPropertyKey: function IsPropertyKey(argument) { return typeof argument === 'string' || typeof argument === 'symbol'; }, // https://ecma-international.org/ecma-262/6.0/#sec-isregexp IsRegExp: function IsRegExp(argument) { if (!argument || typeof argument !== 'object') { return false; } if (hasSymbols) { var isRegExp = argument[$Symbol.match]; if (typeof isRegExp !== 'undefined') { return ES5.ToBoolean(isRegExp); } } return hasRegExpMatcher(argument); }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue // SameValue: ES5.SameValue, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero SameValueZero: function SameValueZero(x, y) { return (x === y) || ($isNaN(x) && $isNaN(y)); }, /** * 7.3.2 GetV (V, P) * 1. Assert: IsPropertyKey(P) is true. * 2. Let O be ToObject(V). * 3. ReturnIfAbrupt(O). * 4. Return O.[[Get]](P, V). */ GetV: function GetV(V, P) { // 7.3.2.1 if (!this.IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } // 7.3.2.2-3 var O = this.ToObject(V); // 7.3.2.4 return O[P]; }, /** * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod * 1. Assert: IsPropertyKey(P) is true. * 2. Let func be GetV(O, P). * 3. ReturnIfAbrupt(func). * 4. If func is either undefined or null, return undefined. * 5. If IsCallable(func) is false, throw a TypeError exception. * 6. Return func. */ GetMethod: function GetMethod(O, P) { // 7.3.9.1 if (!this.IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } // 7.3.9.2 var func = this.GetV(O, P); // 7.3.9.4 if (func == null) { return void 0; } // 7.3.9.5 if (!this.IsCallable(func)) { throw new $TypeError(P + 'is not a function'); } // 7.3.9.6 return func; }, /** * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p * 1. Assert: Type(O) is Object. * 2. Assert: IsPropertyKey(P) is true. * 3. Return O.[[Get]](P, O). */ Get: function Get(O, P) { // 7.3.1.1 if (this.Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } // 7.3.1.2 if (!this.IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } // 7.3.1.3 return O[P]; }, Type: function Type(x) { if (typeof x === 'symbol') { return 'Symbol'; } return ES5.Type(x); }, // https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) { if (this.Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } var C = O.constructor; if (typeof C === 'undefined') { return defaultConstructor; } if (this.Type(C) !== 'Object') { throw new $TypeError('O.constructor is not an Object'); } var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0; if (S == null) { return defaultConstructor; } if (this.IsConstructor(S)) { return S; } throw new $TypeError('no constructor found'); }, // https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) { if (!this.IsPropertyDescriptor(Desc)) { throw new $TypeError('Desc must be a Property Descriptor'); } if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { if (!has(Desc, '[[Value]]')) { Desc['[[Value]]'] = void 0; } if (!has(Desc, '[[Writable]]')) { Desc['[[Writable]]'] = false; } } else { if (!has(Desc, '[[Get]]')) { Desc['[[Get]]'] = void 0; } if (!has(Desc, '[[Set]]')) { Desc['[[Set]]'] = void 0; } } if (!has(Desc, '[[Enumerable]]')) { Desc['[[Enumerable]]'] = false; } if (!has(Desc, '[[Configurable]]')) { Desc['[[Configurable]]'] = false; } return Desc; }, // https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw Set: function Set(O, P, V, Throw) { if (this.Type(O) !== 'Object') { throw new $TypeError('O must be an Object'); } if (!this.IsPropertyKey(P)) { throw new $TypeError('P must be a Property Key'); } if (this.Type(Throw) !== 'Boolean') { throw new $TypeError('Throw must be a Boolean'); } if (Throw) { O[P] = V; return true; } else { try { O[P] = V; } catch (e) { return false; } } }, // https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty HasOwnProperty: function HasOwnProperty(O, P) { if (this.Type(O) !== 'Object') { throw new $TypeError('O must be an Object'); } if (!this.IsPropertyKey(P)) { throw new $TypeError('P must be a Property Key'); } return has(O, P); }, // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty HasProperty: function HasProperty(O, P) { if (this.Type(O) !== 'Object') { throw new $TypeError('O must be an Object'); } if (!this.IsPropertyKey(P)) { throw new $TypeError('P must be a Property Key'); } return P in O; }, // https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable IsConcatSpreadable: function IsConcatSpreadable(O) { if (this.Type(O) !== 'Object') { return false; } if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') { var spreadable = this.Get(O, Symbol.isConcatSpreadable); if (typeof spreadable !== 'undefined') { return this.ToBoolean(spreadable); } } return this.IsArray(O); }, // https://ecma-international.org/ecma-262/6.0/#sec-invoke Invoke: function Invoke(O, P) { if (!this.IsPropertyKey(P)) { throw new $TypeError('P must be a Property Key'); } var argumentsList = arraySlice(arguments, 2); var func = this.GetV(O, P); return this.Call(func, O, argumentsList); }, // https://ecma-international.org/ecma-262/6.0/#sec-getiterator GetIterator: function GetIterator(obj, method) { if (!hasSymbols) { throw new SyntaxError('ES.GetIterator depends on native iterator support.'); } var actualMethod = method; if (arguments.length < 2) { actualMethod = this.GetMethod(obj, $Symbol.iterator); } var iterator = this.Call(actualMethod, obj); if (this.Type(iterator) !== 'Object') { throw new $TypeError('iterator must return an object'); } return iterator; }, // https://ecma-international.org/ecma-262/6.0/#sec-iteratornext IteratorNext: function IteratorNext(iterator, value) { var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); if (this.Type(result) !== 'Object') { throw new $TypeError('iterator next must return an object'); } return result; }, // https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete IteratorComplete: function IteratorComplete(iterResult) { if (this.Type(iterResult) !== 'Object') { throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); } return this.ToBoolean(this.Get(iterResult, 'done')); }, // https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue IteratorValue: function IteratorValue(iterResult) { if (this.Type(iterResult) !== 'Object') { throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); } return this.Get(iterResult, 'value'); }, // https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep IteratorStep: function IteratorStep(iterator) { var result = this.IteratorNext(iterator); var done = this.IteratorComplete(result); return done === true ? false : result; }, // https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose IteratorClose: function IteratorClose(iterator, completion) { if (this.Type(iterator) !== 'Object') { throw new $TypeError('Assertion failed: Type(iterator) is not Object'); } if (!this.IsCallable(completion)) { throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); } var completionThunk = completion; var iteratorReturn = this.GetMethod(iterator, 'return'); if (typeof iteratorReturn === 'undefined') { return completionThunk(); } var completionRecord; try { var innerResult = this.Call(iteratorReturn, iterator, []); } catch (e) { // if we hit here, then "e" is the innerResult completion that needs re-throwing // if the completion is of type "throw", this will throw. completionRecord = completionThunk(); completionThunk = null; // ensure it's not called twice. // if not, then return the innerResult completion throw e; } completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does completionThunk = null; // ensure it's not called twice. if (this.Type(innerResult) !== 'Object') { throw new $TypeError('iterator .return must return an object'); } return completionRecord; }, // https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject CreateIterResultObject: function CreateIterResultObject(value, done) { if (this.Type(done) !== 'Boolean') { throw new $TypeError('Assertion failed: Type(done) is not Boolean'); } return { value: value, done: done }; }, // https://ecma-international.org/ecma-262/6.0/#sec-regexpexec RegExpExec: function RegExpExec(R, S) { if (this.Type(R) !== 'Object') { throw new $TypeError('R must be an Object'); } if (this.Type(S) !== 'String') { throw new $TypeError('S must be a String'); } var exec = this.Get(R, 'exec'); if (this.IsCallable(exec)) { var result = this.Call(exec, R, [S]); if (result === null || this.Type(result) === 'Object') { return result; } throw new $TypeError('"exec" method must return `null` or an Object'); } return regexExec(R, S); }, // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) { if (!this.IsInteger(length) || length < 0) { throw new $TypeError('Assertion failed: length must be an integer >= 0'); } var len = length === 0 ? 0 : length; var C; var isArray = this.IsArray(originalArray); if (isArray) { C = this.Get(originalArray, 'constructor'); // TODO: figure out how to make a cross-realm normal Array, a same-realm Array // if (this.IsConstructor(C)) { // if C is another realm's Array, C = undefined // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? // } if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) { C = this.Get(C, $Symbol.species); if (C === null) { C = void 0; } } } if (typeof C === 'undefined') { return $Array(len); } if (!this.IsConstructor(C)) { throw new $TypeError('C must be a constructor'); } return new C(len); // this.Construct(C, len); }, CreateDataProperty: function CreateDataProperty(O, P, V) { if (this.Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } if (!this.IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } var oldDesc = $gOPD(O, P); var extensible = oldDesc || (typeof $isExtensible !== 'function' || $isExtensible(O)); var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable); if (immutable || !extensible) { return false; } var newDesc = { configurable: true, enumerable: true, value: V, writable: true }; Object.defineProperty(O, P, newDesc); return true; }, // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) { if (this.Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } if (!this.IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } var success = this.CreateDataProperty(O, P, V); if (!success) { throw new $TypeError('unable to create data property'); } return success; }, // https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate ObjectCreate: function ObjectCreate(proto, internalSlotsList) { if (proto !== null && this.Type(proto) !== 'Object') { throw new $TypeError('Assertion failed: proto must be null or an object'); } var slots = arguments.length < 2 ? [] : internalSlotsList; if (slots.length > 0) { throw new $SyntaxError('es-abstract does not yet support internal slots'); } if (proto === null && !$ObjectCreate) { throw new $SyntaxError('native Object.create support is required to create null objects'); } return $ObjectCreate(proto); }, // https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) { if (this.Type(S) !== 'String') { throw new $TypeError('S must be a String'); } if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53'); } if (this.Type(unicode) !== 'Boolean') { throw new $TypeError('Assertion failed: unicode must be a Boolean'); } if (!unicode) { return index + 1; } var length = S.length; if ((index + 1) >= length) { return index + 1; } var first = $charCodeAt(S, index); if (first < 0xD800 || first > 0xDBFF) { return index + 1; } var second = $charCodeAt(S, index + 1); if (second < 0xDC00 || second > 0xDFFF) { return index + 1; } return index + 2; } }); delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible module.exports = ES6; /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; var slice = Array.prototype.slice; var toStr = Object.prototype.toString; var funcType = '[object Function]'; module.exports = function bind(that) { var target = this; if (typeof target !== 'function' || toStr.call(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args = slice.call(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, args.concat(slice.call(arguments)) ); if (Object(result) === result) { return result; } return this; } else { return target.apply( that, args.concat(slice.call(arguments)) ); } }; var boundLength = Math.max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { boundArgs.push('$' + i); } bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; var isPrimitive = __webpack_require__(9); var isCallable = __webpack_require__(3); var isDate = __webpack_require__(29); var isSymbol = __webpack_require__(30); var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { if (typeof O === 'undefined' || O === null) { throw new TypeError('Cannot call method on ' + O); } if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { throw new TypeError('hint must be "string" or "number"'); } var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; var method, result, i; for (i = 0; i < methodNames.length; ++i) { method = O[methodNames[i]]; if (isCallable(method)) { result = method.call(O); if (isPrimitive(result)) { return result; } } } throw new TypeError('No default value'); }; var GetMethod = function GetMethod(O, P) { var func = O[P]; if (func !== null && typeof func !== 'undefined') { if (!isCallable(func)) { throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); } return func; } }; // http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive module.exports = function ToPrimitive(input, PreferredType) { if (isPrimitive(input)) { return input; } var hint = 'default'; if (arguments.length > 1) { if (PreferredType === String) { hint = 'string'; } else if (PreferredType === Number) { hint = 'number'; } } var exoticToPrim; if (hasSymbols) { if (Symbol.toPrimitive) { exoticToPrim = GetMethod(input, Symbol.toPrimitive); } else if (isSymbol(input)) { exoticToPrim = Symbol.prototype.valueOf; } } if (typeof exoticToPrim !== 'undefined') { var result = exoticToPrim.call(input, hint); if (isPrimitive(result)) { return result; } throw new TypeError('unable to convert exotic object to primitive'); } if (hint === 'default' && (isDate(input) || isSymbol(input))) { hint = 'string'; } return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); }; /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getDay = Date.prototype.getDay; var tryDateObject = function tryDateObject(value) { try { getDay.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var dateClass = '[object Date]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isDateObject(value) { if (typeof value !== 'object' || value === null) { return false; } return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; }; /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toStr = Object.prototype.toString; var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; if (hasSymbols) { var symToStr = Symbol.prototype.toString; var symStringRegex = /^Symbol\(.*\)$/; var isSymbolObject = function isSymbolObject(value) { if (typeof value.valueOf() !== 'symbol') { return false; } return symStringRegex.test(symToStr.call(value)); }; module.exports = function isSymbol(value) { if (typeof value === 'symbol') { return true; } if (toStr.call(value) !== '[object Symbol]') { return false; } try { return isSymbolObject(value); } catch (e) { return false; } }; } else { module.exports = function isSymbol(value) { // this environment does not support Symbols. return false; }; } /***/ }), /* 31 */ /***/ (function(module, exports) { module.exports = function isPrimitive(value) { return value === null || (typeof value !== 'function' && typeof value !== 'object'); }; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(10); var $Object = GetIntrinsic('%Object%'); var $TypeError = GetIntrinsic('%TypeError%'); var $String = GetIntrinsic('%String%'); var $isNaN = __webpack_require__(11); var $isFinite = __webpack_require__(12); var sign = __webpack_require__(14); var mod = __webpack_require__(15); var IsCallable = __webpack_require__(3); var toPrimitive = __webpack_require__(33); var has = __webpack_require__(1); // https://es5.github.io/#x9 var ES5 = { ToPrimitive: toPrimitive, ToBoolean: function ToBoolean(value) { return !!value; }, ToNumber: function ToNumber(value) { return +value; // eslint-disable-line no-implicit-coercion }, ToInteger: function ToInteger(value) { var number = this.ToNumber(value); if ($isNaN(number)) { return 0; } if (number === 0 || !$isFinite(number)) { return number; } return sign(number) * Math.floor(Math.abs(number)); }, ToInt32: function ToInt32(x) { return this.ToNumber(x) >> 0; }, ToUint32: function ToUint32(x) { return this.ToNumber(x) >>> 0; }, ToUint16: function ToUint16(value) { var number = this.ToNumber(value); if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } var posInt = sign(number) * Math.floor(Math.abs(number)); return mod(posInt, 0x10000); }, ToString: function ToString(value) { return $String(value); }, ToObject: function ToObject(value) { this.CheckObjectCoercible(value); return $Object(value); }, CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { /* jshint eqnull:true */ if (value == null) { throw new $TypeError(optMessage || 'Cannot call method on ' + value); } return value; }, IsCallable: IsCallable, SameValue: function SameValue(x, y) { if (x === y) { // 0 === -0, but they are not identical. if (x === 0) { return 1 / x === 1 / y; } return true; } return $isNaN(x) && $isNaN(y); }, // https://www.ecma-international.org/ecma-262/5.1/#sec-8 Type: function Type(x) { if (x === null) { return 'Null'; } if (typeof x === 'undefined') { return 'Undefined'; } if (typeof x === 'function' || typeof x === 'object') { return 'Object'; } if (typeof x === 'number') { return 'Number'; } if (typeof x === 'boolean') { return 'Boolean'; } if (typeof x === 'string') { return 'String'; } }, // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type IsPropertyDescriptor: function IsPropertyDescriptor(Desc) { if (this.Type(Desc) !== 'Object') { return false; } var allowed = { '[[Configurable]]': true, '[[Enumerable]]': true, '[[Get]]': true, '[[Set]]': true, '[[Value]]': true, '[[Writable]]': true }; // jscs:disable for (var key in Desc) { // eslint-disable-line if (has(Desc, key) && !allowed[key]) { return false; } } // jscs:enable var isData = has(Desc, '[[Value]]'); var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); if (isData && IsAccessor) { throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); } return true; }, // https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 IsAccessorDescriptor: function IsAccessorDescriptor(Desc) { if (typeof Desc === 'undefined') { return false; } if (!this.IsPropertyDescriptor(Desc)) { throw new $TypeError('Desc must be a Property Descriptor'); } if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { return false; } return true; }, // https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 IsDataDescriptor: function IsDataDescriptor(Desc) { if (typeof Desc === 'undefined') { return false; } if (!this.IsPropertyDescriptor(Desc)) { throw new $TypeError('Desc must be a Property Descriptor'); } if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { return false; } return true; }, // https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 IsGenericDescriptor: function IsGenericDescriptor(Desc) { if (typeof Desc === 'undefined') { return false; } if (!this.IsPropertyDescriptor(Desc)) { throw new $TypeError('Desc must be a Property Descriptor'); } if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) { return true; } return false; }, // https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { if (typeof Desc === 'undefined') { return Desc; } if (!this.IsPropertyDescriptor(Desc)) { throw new $TypeError('Desc must be a Property Descriptor'); } if (this.IsDataDescriptor(Desc)) { return { value: Desc['[[Value]]'], writable: !!Desc['[[Writable]]'], enumerable: !!Desc['[[Enumerable]]'], configurable: !!Desc['[[Configurable]]'] }; } else if (this.IsAccessorDescriptor(Desc)) { return { get: Desc['[[Get]]'], set: Desc['[[Set]]'], enumerable: !!Desc['[[Enumerable]]'], configurable: !!Desc['[[Configurable]]'] }; } else { throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); } }, // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 ToPropertyDescriptor: function ToPropertyDescriptor(Obj) { if (this.Type(Obj) !== 'Object') { throw new $TypeError('ToPropertyDescriptor requires an object'); } var desc = {}; if (has(Obj, 'enumerable')) { desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable); } if (has(Obj, 'configurable')) { desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable); } if (has(Obj, 'value')) { desc['[[Value]]'] = Obj.value; } if (has(Obj, 'writable')) { desc['[[Writable]]'] = this.ToBoolean(Obj.writable); } if (has(Obj, 'get')) { var getter = Obj.get; if (typeof getter !== 'undefined' && !this.IsCallable(getter)) { throw new TypeError('getter must be a function'); } desc['[[Get]]'] = getter; } if (has(Obj, 'set')) { var setter = Obj.set; if (typeof setter !== 'undefined' && !this.IsCallable(setter)) { throw new $TypeError('setter must be a function'); } desc['[[Set]]'] = setter; } if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); } return desc; } }; module.exports = ES5; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toStr = Object.prototype.toString; var isPrimitive = __webpack_require__(9); var isCallable = __webpack_require__(3); // https://es5.github.io/#x8.12 var ES5internalSlots = { '[[DefaultValue]]': function (O, hint) { var actualHint = hint || (toStr.call(O) === '[object Date]' ? String : Number); if (actualHint === String || actualHint === Number) { var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; var value, i; for (i = 0; i < methods.length; ++i) { if (isCallable(O[methods[i]])) { value = O[methods[i]](); if (isPrimitive(value)) { return value; } } } throw new TypeError('No default value'); } throw new TypeError('invalid [[DefaultValue]] hint supplied'); } }; // https://es5.github.io/#x9 module.exports = function ToPrimitive(input, PreferredType) { if (isPrimitive(input)) { return input; } return ES5internalSlots['[[DefaultValue]]'](input, PreferredType); }; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = __webpack_require__(1); var regexExec = RegExp.prototype.exec; var gOPD = Object.getOwnPropertyDescriptor; var tryRegexExecCall = function tryRegexExec(value) { try { var lastIndex = value.lastIndex; value.lastIndex = 0; regexExec.call(value); return true; } catch (e) { return false; } finally { value.lastIndex = lastIndex; } }; var toStr = Object.prototype.toString; var regexClass = '[object RegExp]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isRegex(value) { if (!value || typeof value !== 'object') { return false; } if (!hasToStringTag) { return toStr.call(value) === regexClass; } var descriptor = gOPD(value, 'lastIndex'); var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); if (!hasLastIndexDataProperty) { return false; } return tryRegexExecCall(value); }; /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getPolyfill = __webpack_require__(16); var define = __webpack_require__(7); module.exports = function shimEntries() { var polyfill = getPolyfill(); define(Object, { entries: polyfill }, { entries: function testEntries() { return Object.entries !== polyfill; } }); return polyfill; }; /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var config_1 = __webpack_require__(0); var common_1 = __webpack_require__(4); /** * Calculate the column widths */ function calculateWidths(doc, pageWidth) { var table = config_1.Config.tableInstance(); // Column and table content width var fixedWidth = 0; var autoWidth = 0; var dynamicColumns = []; table.columns.forEach(function (column) { column.contentWidth = 0; table.rows.concat(table.headerRow).forEach(function (row) { var cell = row.cells[column.dataKey]; cell.contentWidth = cell.padding('horizontal') + common_1.getStringWidth(cell.text, cell.styles); if (cell.contentWidth > column.contentWidth) { column.contentWidth = cell.contentWidth; } }); table.contentWidth += column.contentWidth; if (typeof column.widthStyle === 'number') { column.preferredWidth = column.widthStyle; fixedWidth += column.preferredWidth; column.width = column.preferredWidth; } else if (column.widthStyle === 'wrap') { column.preferredWidth = column.contentWidth; fixedWidth += column.preferredWidth; column.width = column.preferredWidth; } else { column.preferredWidth = column.contentWidth; autoWidth += column.contentWidth; dynamicColumns.push(column); } table.preferredWidth += column.preferredWidth; }); if (typeof table.settings.tableWidth === 'number') { table.width = table.settings.tableWidth; } else if (table.settings.tableWidth === 'wrap') { table.width = table.preferredWidth; } else { table.width = pageWidth - table.margin('left') - table.margin('right'); } distributeWidth(dynamicColumns, fixedWidth, autoWidth, 0); // Row height, table height and text overflow var all = table.rows.concat(table.headerRow); all.forEach(function (row) { table.columns.forEach(function (col) { var cell = row.cells[col.dataKey]; config_1.Config.applyStyles(cell.styles); var textSpace = col.width - cell.padding('horizontal'); var k = config_1.Config.scaleFactor(); if (cell.styles.overflow === 'linebreak') { // Add one pt to textSpace to fix rounding error try { cell.text = doc.splitTextToSize(cell.text, textSpace + 1 / k, { fontSize: cell.styles.fontSize }); } catch (e) { if (e instanceof TypeError && Array.isArray(cell.text)) { cell.text = doc.splitTextToSize(cell.text.join(' '), textSpace + 1 / k, { fontSize: cell.styles.fontSize }); } else { throw e; } } } else if (cell.styles.overflow === 'ellipsize') { cell.text = common_1.ellipsize(cell.text, textSpace, cell.styles); } else if (cell.styles.overflow === 'visible') { // Do nothing } else if (cell.styles.overflow === 'hidden') { cell.text = common_1.ellipsize(cell.text, textSpace, cell.styles, ''); } else if (typeof cell.styles.overflow === 'function') { cell.text = cell.styles.overflow(cell.text, textSpace); } else { console.error("Unrecognized overflow type: " + cell.styles.overflow); } var lineCount = Array.isArray(cell.text) ? cell.text.length : 1; var fontHeight = cell.styles.fontSize / k * config_1.FONT_ROW_RATIO; cell.contentHeight = lineCount * fontHeight + cell.padding('vertical'); if (cell.contentHeight > row.height) { row.height = cell.contentHeight; row.maxLineCount = lineCount; } }); table.height += row.height; }); } exports.calculateWidths = calculateWidths; function distributeWidth(dynamicColumns, staticWidth, dynamicColumnsContentWidth, fairWidth) { var table = config_1.Config.tableInstance(); var extraWidth = table.width - staticWidth - dynamicColumnsContentWidth; for (var i = 0; i < dynamicColumns.length; i++) { var col = dynamicColumns[i]; var ratio = col.contentWidth / dynamicColumnsContentWidth; // A column turned out to be none dynamic, start over recursively var isNoneDynamic = col.contentWidth + extraWidth * ratio < fairWidth; if (extraWidth < 0 && isNoneDynamic) { dynamicColumns.splice(i, 1); dynamicColumnsContentWidth -= col.contentWidth; col.width = fairWidth; staticWidth += col.width; distributeWidth(dynamicColumns, staticWidth, dynamicColumnsContentWidth, fairWidth); break; } else { col.width = col.contentWidth + extraWidth * ratio; } } } /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var models_1 = __webpack_require__(5); var config_1 = __webpack_require__(0); var assign = __webpack_require__(6); function validateInput(headers, data, allOptions) { if (!headers || typeof headers !== 'object') { console.error("The headers should be an object or array, is: " + typeof headers); } if (!data || typeof data !== 'object') { console.error("The data should be an object or array, is: " + typeof data); } var _loop_1 = function (settings) { if (settings && typeof settings !== 'object') { console.error("The options parameter should be of type object, is: " + typeof settings); } if (typeof settings.extendWidth !== 'undefined') { settings.tableWidth = settings.extendWidth ? 'auto' : 'wrap'; console.error("Use of deprecated option: extendWidth, use tableWidth instead."); } if (typeof settings.margins !== 'undefined') { if (typeof settings.margin === 'undefined') settings.margin = settings.margins; console.error("Use of deprecated option: margins, use margin instead."); } if (typeof settings.afterPageContent !== 'undefined' || typeof settings.beforePageContent !== 'undefined' || typeof settings.afterPageAdd !== 'undefined') { console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use addPageContent instead"); if (typeof settings.addPageContent === 'undefined') { settings.addPageContent = function (data) { config_1.Config.applyUserStyles(); if (settings.beforePageContent) settings.beforePageContent(data); config_1.Config.applyUserStyles(); if (settings.afterPageContent) settings.afterPageContent(data); config_1.Config.applyUserStyles(); if (settings.afterPageAdd && data.pageCount > 1) { data.afterPageAdd(data); } config_1.Config.applyUserStyles(); }; } } [['padding', 'cellPadding'], ['lineHeight', 'rowHeight'], 'fontSize', 'overflow'].forEach(function (o) { var deprecatedOption = typeof o === 'string' ? o : o[0]; var style = typeof o === 'string' ? o : o[1]; if (typeof settings[deprecatedOption] !== 'undefined') { if (typeof settings.styles[style] === 'undefined') { settings.styles[style] = settings[deprecatedOption]; } console.error("Use of deprecated option: " + deprecatedOption + ", use the style " + style + " instead."); } }); for (var _i = 0, _a = ['styles', 'bodyStyles', 'headerStyles', 'columnStyles']; _i < _a.length; _i++) { var styleProp = _a[_i]; if (settings[styleProp] && typeof settings[styleProp] !== 'object') { console.error("The " + styleProp + " style should be of type object, is: " + typeof settings[styleProp]); } else if (settings[styleProp] && settings[styleProp].rowHeight) { console.error("Use of deprecated style: rowHeight, use vertical cell padding instead"); } } }; for (var _i = 0, allOptions_1 = allOptions; _i < allOptions_1.length; _i++) { var settings = allOptions_1[_i]; _loop_1(settings); } } exports.validateInput = validateInput; /** * Create models from the user input * * @param inputHeaders * @param inputData */ function createModels(inputHeaders, inputData) { var splitRegex = /\r\n|\r|\n/g; var table = config_1.Config.tableInstance(); var settings = table.settings; var theme = config_1.getTheme(settings.theme); // Header row and columns var headerRow = new models_1.Row(inputHeaders, -1); headerRow.index = -1; // Columns and header row inputHeaders.forEach(function (rawColumn, index) { var dataKey = index; if (typeof rawColumn.dataKey !== 'undefined') { dataKey = rawColumn.dataKey; } else if (typeof rawColumn.key !== 'undefined') { console.error("Deprecation warning: Use dataKey instead of key"); dataKey = rawColumn.key; // deprecated since 2.x } var col = new models_1.Column(dataKey, index); col.raw = rawColumn; col.widthStyle = config_1.Config.styles([theme.table, theme.header, table.styles.styles, table.styles.columnStyles[col.dataKey] || {}]).columnWidth; table.columns.push(col); var cell = new models_1.Cell(rawColumn); cell.styles = config_1.Config.styles([theme.table, theme.header, table.styles.styles, table.styles.headerStyles]); if (cell.raw instanceof HTMLElement) { cell.text = (cell.raw.innerText || '').trim(); } else { var text = typeof cell.raw === 'object' ? cell.raw.title : cell.raw; // Stringify 0 and false, but not undefined cell.text = typeof cell.raw !== 'undefined' ? '' + text : ''; } cell.text = cell.text.split(splitRegex); headerRow.cells[dataKey] = cell; for (var _i = 0, _a = table.hooks.createdHeaderCell; _i < _a.length; _i++) { var hook = _a[_i]; hook(cell, { cell: cell, column: col, row: headerRow, settings: settings }); } }); table.headerRow = headerRow; // Rows och cells inputData.forEach(function (rawRow, i) { var row = new models_1.Row(rawRow, i); var rowStyles = i % 2 === 0 ? assign({}, theme.alternateRow, table.styles.alternateRowStyles) : {}; table.columns.forEach(function (column) { var cell = new models_1.Cell(rawRow[column.dataKey]); var colStyles = table.styles.columnStyles[column.dataKey] || {}; cell.styles = config_1.Config.styles([theme.table, theme.body, table.styles.styles, table.styles.bodyStyles, rowStyles, colStyles]); if (cell.raw && cell.raw instanceof HTMLElement) { cell.text = (cell.raw.innerText || '').trim(); } else { // Stringify 0 and false, but not undefined cell.text = typeof cell.raw !== 'undefined' ? '' + cell.raw : ''; } cell.text = cell.text.split(splitRegex); row.cells[column.dataKey] = cell; for (var _i = 0, _a = table.hooks.createdCell; _i < _a.length; _i++) { var hook = _a[_i]; hook(cell, config_1.Config.hooksData({ cell: cell, column: column, row: row })); } }); table.rows.push(row); }); } exports.createModels = createModels; /***/ }) /******/ ]); });