\").addClass(SCROLLVIEW_REACHBOTTOM_TEXT_CLASS);\r\n this._updateReachBottomText();\r\n $reachBottom.append($loadContainer.append($loadIndicator)).append($text);\r\n $bottomPocket.append($reachBottom);\r\n this._$content.append($bottomPocket)\r\n },\r\n _initLoadPanel: function() {\r\n var $loadPanelElement = $(\"
\").addClass(SCROLLVIEW_LOADPANEL).appendTo(this.$element());\r\n var loadPanelOptions = {\r\n shading: false,\r\n delay: 400,\r\n message: this.option(\"refreshingText\"),\r\n position: {\r\n of: this.$element()\r\n }\r\n };\r\n this._loadPanel = this._createComponent($loadPanelElement, LoadPanel, loadPanelOptions)\r\n },\r\n _updateReachBottomText: function() {\r\n this._$reachBottomText.text(this.option(\"reachBottomText\"))\r\n },\r\n _createStrategy: function() {\r\n var strategyName = this.option(\"useNative\") ? this.option(\"refreshStrategy\") : \"simulated\";\r\n var strategyClass = refreshStrategies[strategyName];\r\n this._strategy = new strategyClass(this);\r\n this._strategy.pullDownCallbacks.add(this._pullDownHandler.bind(this));\r\n this._strategy.releaseCallbacks.add(this._releaseHandler.bind(this));\r\n this._strategy.reachBottomCallbacks.add(this._reachBottomHandler.bind(this))\r\n },\r\n _createActions: function() {\r\n this.callBase();\r\n this._pullDownAction = this._createActionByOption(\"onPullDown\");\r\n this._reachBottomAction = this._createActionByOption(\"onReachBottom\");\r\n this._tryRefreshPocketState()\r\n },\r\n _tryRefreshPocketState: function() {\r\n this._pullDownEnable(this.hasActionSubscription(\"onPullDown\"));\r\n this._reachBottomEnable(this.hasActionSubscription(\"onReachBottom\"))\r\n },\r\n on: function(eventName) {\r\n var result = this.callBase.apply(this, arguments);\r\n if (\"pullDown\" === eventName || \"reachBottom\" === eventName) {\r\n this._tryRefreshPocketState()\r\n }\r\n return result\r\n },\r\n _pullDownEnable: function(enabled) {\r\n if (0 === arguments.length) {\r\n return this._pullDownEnabled\r\n }\r\n if (this._$pullDown && this._strategy) {\r\n this._$pullDown.toggle(enabled);\r\n this._strategy.pullDownEnable(enabled);\r\n this._pullDownEnabled = enabled\r\n }\r\n },\r\n _reachBottomEnable: function(enabled) {\r\n if (0 === arguments.length) {\r\n return this._reachBottomEnabled\r\n }\r\n if (this._$reachBottom && this._strategy) {\r\n this._$reachBottom.toggle(enabled);\r\n this._strategy.reachBottomEnable(enabled);\r\n this._reachBottomEnabled = enabled\r\n }\r\n },\r\n _pullDownHandler: function() {\r\n this._loadingIndicator(false);\r\n this._pullDownLoading()\r\n },\r\n _loadingIndicator: function(value) {\r\n if (arguments.length < 1) {\r\n return this._loadingIndicatorEnabled\r\n }\r\n this._loadingIndicatorEnabled = value\r\n },\r\n _pullDownLoading: function() {\r\n this.startLoading();\r\n this._pullDownAction()\r\n },\r\n _reachBottomHandler: function() {\r\n this._loadingIndicator(false);\r\n this._reachBottomLoading()\r\n },\r\n _reachBottomLoading: function() {\r\n this.startLoading();\r\n this._reachBottomAction()\r\n },\r\n _releaseHandler: function() {\r\n this.finishLoading();\r\n this._loadingIndicator(true)\r\n },\r\n _optionChanged: function(args) {\r\n switch (args.name) {\r\n case \"onPullDown\":\r\n case \"onReachBottom\":\r\n this._createActions();\r\n break;\r\n case \"pullingDownText\":\r\n case \"pulledDownText\":\r\n case \"refreshingText\":\r\n case \"refreshStrategy\":\r\n this._invalidate();\r\n break;\r\n case \"reachBottomText\":\r\n this._updateReachBottomText();\r\n break;\r\n default:\r\n this.callBase(args)\r\n }\r\n },\r\n content: function() {\r\n return getPublicElement(this._$content.children().eq(1))\r\n },\r\n release: function(preventReachBottom) {\r\n if (void 0 !== preventReachBottom) {\r\n this.toggleLoading(!preventReachBottom)\r\n }\r\n return this._strategy.release()\r\n },\r\n toggleLoading: function(showOrHide) {\r\n this._reachBottomEnable(showOrHide)\r\n },\r\n refresh: function() {\r\n if (!this.hasActionSubscription(\"onPullDown\")) {\r\n return\r\n }\r\n this._strategy.pendingRelease();\r\n this._pullDownLoading()\r\n },\r\n startLoading: function() {\r\n if (this._loadingIndicator() && this.$element().is(\":visible\")) {\r\n this._loadPanel.show()\r\n }\r\n this._lock()\r\n },\r\n finishLoading: function() {\r\n this._loadPanel.hide();\r\n this._unlock()\r\n },\r\n _dispose: function() {\r\n this._strategy.dispose();\r\n this.callBase();\r\n if (this._loadPanel) {\r\n this._loadPanel.$element().remove()\r\n }\r\n }\r\n});\r\nregisterComponent(\"dxScrollView\", ScrollView);\r\nexport default ScrollView;\r\n","/**\r\n * DevExtreme (esm/ui/scroll_view.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport ScrollView from \"./scroll_view/ui.scroll_view\";\r\nexport default ScrollView;\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/common/normalizeOptions.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isNumeric\r\n} from \"../../../core/utils/type\";\r\n\r\nfunction normalizeBoundaryValue(value) {\r\n var _value$top, _value$right, _value$bottom, _value$left;\r\n if (isNumeric(value)) {\r\n return {\r\n top: value,\r\n right: value,\r\n bottom: value,\r\n left: value\r\n }\r\n }\r\n return {\r\n top: null !== (_value$top = null === value || void 0 === value ? void 0 : value.top) && void 0 !== _value$top ? _value$top : 0,\r\n right: null !== (_value$right = null === value || void 0 === value ? void 0 : value.right) && void 0 !== _value$right ? _value$right : 0,\r\n bottom: null !== (_value$bottom = null === value || void 0 === value ? void 0 : value.bottom) && void 0 !== _value$bottom ? _value$bottom : 0,\r\n left: null !== (_value$left = null === value || void 0 === value ? void 0 : value.left) && void 0 !== _value$left ? _value$left : 0\r\n }\r\n}\r\n\r\nfunction normalizeRowsInfo(rowsInfo) {\r\n rowsInfo.forEach(row => {\r\n row.cells.forEach(_ref => {\r\n var {\r\n pdfCell: pdfCell\r\n } = _ref;\r\n pdfCell.padding = normalizeBoundaryValue(pdfCell.padding)\r\n })\r\n })\r\n}\r\nexport {\r\n normalizeRowsInfo,\r\n normalizeBoundaryValue\r\n};\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/common/pdf_utils.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isDefined\r\n} from \"../../../core/utils/type\";\r\nvar DOTS_TEXT = \"...\";\r\n\r\nfunction toPdfUnit(doc, value) {\r\n var coefficient = 1 / doc.internal.scaleFactor;\r\n return value * coefficient\r\n}\r\n\r\nfunction getPageWidth(doc) {\r\n return doc.internal.pageSize.getWidth()\r\n}\r\n\r\nfunction getPageHeight(doc) {\r\n return doc.internal.pageSize.getHeight()\r\n}\r\n\r\nfunction getTextLines(doc, text, font, _ref) {\r\n var {\r\n wordWrapEnabled: wordWrapEnabled,\r\n targetRectWidth: targetRectWidth\r\n } = _ref;\r\n if (wordWrapEnabled) {\r\n var usedFont = doc.getFont(null === font || void 0 === font ? void 0 : font.name, null === font || void 0 === font ? void 0 : font.style);\r\n return doc.splitTextToSize(text, targetRectWidth, {\r\n fontSize: (null === font || void 0 === font ? void 0 : font.size) || doc.getFontSize(),\r\n fontName: usedFont.fontName,\r\n fontStyle: usedFont.fontStyle\r\n })\r\n }\r\n var textWithoutLineBreak = text.split(\"\\n\").filter(ch => \"\" !== ch).join(\" \");\r\n if (getTextDimensions(doc, textWithoutLineBreak, font).w <= targetRectWidth) {\r\n return [textWithoutLineBreak]\r\n }\r\n var textWidth = getTextDimensions(doc, textWithoutLineBreak + DOTS_TEXT, font).w;\r\n while (textWithoutLineBreak.length > 0 && textWidth > targetRectWidth) {\r\n var symbolsCountToRemove = 0;\r\n if (textWidth >= 2 * targetRectWidth) {\r\n symbolsCountToRemove = textWithoutLineBreak.length / 2\r\n }\r\n if (symbolsCountToRemove < 1) {\r\n symbolsCountToRemove = 1\r\n }\r\n textWithoutLineBreak = textWithoutLineBreak.substring(0, textWithoutLineBreak.length - symbolsCountToRemove);\r\n textWidth = getTextDimensions(doc, textWithoutLineBreak + DOTS_TEXT, font).w\r\n }\r\n return [textWithoutLineBreak + DOTS_TEXT]\r\n}\r\n\r\nfunction calculateTargetRectWidth(columnWidth, padding) {\r\n var width = columnWidth - (padding.left + padding.right);\r\n return width >= 0 ? width : 0\r\n}\r\n\r\nfunction getTextDimensions(doc, text, font) {\r\n return doc.getTextDimensions(text, {\r\n font: doc.getFont(null === font || void 0 === font ? void 0 : font.name, null === font || void 0 === font ? void 0 : font.style),\r\n fontSize: (null === font || void 0 === font ? void 0 : font.size) || doc.getFontSize()\r\n })\r\n}\r\n\r\nfunction calculateTextHeight(doc, text, font, _ref2) {\r\n var {\r\n wordWrapEnabled: wordWrapEnabled,\r\n targetRectWidth: targetRectWidth\r\n } = _ref2;\r\n var heightOfOneLine = getTextDimensions(doc, text, font).h;\r\n var linesCount = getTextLines(doc, text, font, {\r\n wordWrapEnabled: wordWrapEnabled,\r\n targetRectWidth: targetRectWidth\r\n }).length;\r\n return heightOfOneLine * linesCount * doc.getLineHeightFactor()\r\n}\r\n\r\nfunction calculateRowHeight(doc, cells, columnWidths) {\r\n if (cells.length !== columnWidths.length) {\r\n throw \"the cells count must be equal to the count of the columns\"\r\n }\r\n var rowHeight = 0;\r\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\r\n if (isDefined(cells[cellIndex].rowSpan)) {\r\n continue\r\n }\r\n var cellText = cells[cellIndex].pdfCell.text;\r\n var cellPadding = cells[cellIndex].pdfCell.padding;\r\n var font = cells[cellIndex].pdfCell.font;\r\n var wordWrapEnabled = cells[cellIndex].pdfCell.wordWrapEnabled;\r\n var columnWidth = columnWidths[cellIndex];\r\n var targetRectWidth = calculateTargetRectWidth(columnWidth, cellPadding);\r\n if (isDefined(cellText)) {\r\n var textHeight = \"\" !== cellText ? calculateTextHeight(doc, cellText, font, {\r\n wordWrapEnabled: wordWrapEnabled,\r\n targetRectWidth: targetRectWidth\r\n }) : 0;\r\n var cellHeight = textHeight + cellPadding.top + cellPadding.bottom;\r\n if (rowHeight < cellHeight) {\r\n rowHeight = cellHeight\r\n }\r\n }\r\n }\r\n return rowHeight\r\n}\r\n\r\nfunction applyWordWrap(doc, rowsInfo) {\r\n rowsInfo.forEach(row => {\r\n row.cells.forEach(_ref3 => {\r\n var {\r\n pdfCell: pdfCell\r\n } = _ref3;\r\n if (isDefined(pdfCell.text)) {\r\n var lines = getTextLines(doc, pdfCell.text, pdfCell.font, {\r\n wordWrapEnabled: pdfCell.wordWrapEnabled,\r\n targetRectWidth: calculateTargetRectWidth(pdfCell._rect.w, pdfCell.padding)\r\n });\r\n pdfCell.text = lines.join(\"\\n\")\r\n }\r\n })\r\n })\r\n}\r\n\r\nfunction applyRtl(doc, rectsByPages, options) {\r\n rectsByPages.forEach(pageRects => {\r\n pageRects.forEach(pdfCell => {\r\n var mirroredX = getPageWidth(doc) - (pdfCell._rect.x + pdfCell._rect.w);\r\n var marginDiff = options.margin.left - options.margin.right;\r\n pdfCell._rect.x = mirroredX + marginDiff\r\n })\r\n })\r\n}\r\nexport {\r\n calculateRowHeight,\r\n calculateTextHeight,\r\n calculateTargetRectWidth,\r\n getTextLines,\r\n getPageWidth,\r\n getPageHeight,\r\n applyWordWrap,\r\n toPdfUnit,\r\n applyRtl\r\n};\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/common/row_utils.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isDefined,\r\n isNumeric\r\n} from \"../../../core/utils/type\";\r\nimport {\r\n calculateRowHeight,\r\n getPageWidth,\r\n toPdfUnit\r\n} from \"./pdf_utils\";\r\nvar getSum = (a, b) => a + b;\r\n\r\nfunction calculateColumnWidths(doc, dataProvider, topLeftX, margin, customerColumnWidths) {\r\n var resultWidths = dataProvider.getColumnsWidths().map(width => toPdfUnit(doc, null !== width && void 0 !== width ? width : 150));\r\n var totalAutoColumnsWidth = resultWidths.filter((width, index) => !isDefined(customerColumnWidths[index])).reduce(getSum, 0);\r\n var totalCustomerColumnsWidth = customerColumnWidths.filter(width => isNumeric(width)).reduce(getSum, 0);\r\n var availablePageWidth = getAvailablePageAreaWidth(doc, topLeftX, margin);\r\n var ratio = totalCustomerColumnsWidth < availablePageWidth ? (availablePageWidth - totalCustomerColumnsWidth) / totalAutoColumnsWidth : 1;\r\n return resultWidths.map((width, index) => {\r\n var _customerColumnWidths;\r\n return null !== (_customerColumnWidths = customerColumnWidths[index]) && void 0 !== _customerColumnWidths ? _customerColumnWidths : width * ratio\r\n })\r\n}\r\n\r\nfunction getAvailablePageAreaWidth(doc, topLeftX, margin) {\r\n return getPageWidth(doc) - topLeftX - margin.left - margin.right\r\n}\r\n\r\nfunction initializeCellsWidth(doc, dataProvider, rows, options) {\r\n var columnWidths = calculateColumnWidths(doc, dataProvider, options.topLeft.x, options.margin, options.columnWidths);\r\n rows.forEach(row => {\r\n row.cells.forEach((_ref, index) => {\r\n var {\r\n gridCell: gridCell,\r\n pdfCell: pdfCell\r\n } = _ref;\r\n pdfCell._rect.w = columnWidths[index]\r\n })\r\n })\r\n}\r\n\r\nfunction calculateHeights(doc, rows, options) {\r\n rows.forEach(row => {\r\n var pdfCells = row.cells.map(c => c.pdfCell);\r\n var customerHeight;\r\n if (options.onRowExporting) {\r\n var args = {\r\n rowCells: pdfCells\r\n };\r\n options.onRowExporting(args);\r\n if (isDefined(args.rowHeight)) {\r\n customerHeight = args.rowHeight\r\n }\r\n }\r\n row.height = isDefined(customerHeight) ? customerHeight : calculateRowHeight(doc, row.cells, pdfCells.map(c => c._rect.w));\r\n pdfCells.forEach(cell => {\r\n cell._rect.h = row.height\r\n })\r\n })\r\n}\r\n\r\nfunction applyColSpans(rows) {\r\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\r\n var row = rows[rowIndex];\r\n for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {\r\n var cell = row.cells[cellIndex];\r\n if (isDefined(cell.colSpan) && !isDefined(cell.pdfCell.isMerged)) {\r\n for (var spanIndex = 1; spanIndex <= cell.colSpan; spanIndex++) {\r\n var mergedCell = rows[rowIndex].cells[cellIndex + spanIndex];\r\n cell.pdfCell._rect.w += mergedCell.pdfCell._rect.w;\r\n mergedCell.pdfCell._rect.w = 0;\r\n mergedCell.pdfCell.isMerged = true\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction applyRowSpans(rows) {\r\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\r\n var row = rows[rowIndex];\r\n for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {\r\n var cell = row.cells[cellIndex];\r\n if (isDefined(cell.rowSpan) && !isDefined(cell.pdfCell.isMerged)) {\r\n for (var spanIndex = 1; spanIndex <= cell.rowSpan; spanIndex++) {\r\n var mergedCell = rows[rowIndex + spanIndex].cells[cellIndex];\r\n cell.pdfCell._rect.h += mergedCell.pdfCell._rect.h;\r\n mergedCell.pdfCell._rect.h = 0;\r\n mergedCell.pdfCell.isMerged = true\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction resizeFirstColumnByIndentLevel(rows, options) {\r\n rows.forEach(row => {\r\n row.cells[0].pdfCell._rect.w -= row.indentLevel * options.indent\r\n })\r\n}\r\n\r\nfunction applyBordersConfig(rows) {\r\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\r\n var cells = rows[rowIndex].cells;\r\n for (var columnIndex = 0; columnIndex < cells.length; columnIndex++) {\r\n var pdfCell = cells[columnIndex].pdfCell;\r\n var leftPdfCell = columnIndex >= 1 ? cells[columnIndex - 1].pdfCell : null;\r\n var topPdfCell = rowIndex >= 1 ? rows[rowIndex - 1].cells[columnIndex].pdfCell : null;\r\n if (false === pdfCell.drawLeftBorder && !isDefined(cells[columnIndex].colSpan)) {\r\n if (isDefined(leftPdfCell)) {\r\n leftPdfCell.drawRightBorder = false\r\n }\r\n } else if (!isDefined(pdfCell.drawLeftBorder)) {\r\n if (isDefined(leftPdfCell) && false === leftPdfCell.drawRightBorder) {\r\n pdfCell.drawLeftBorder = false\r\n }\r\n }\r\n if (false === pdfCell.drawTopBorder) {\r\n if (isDefined(topPdfCell)) {\r\n topPdfCell.drawBottomBorder = false\r\n }\r\n } else if (!isDefined(pdfCell.drawTopBorder)) {\r\n if (isDefined(topPdfCell) && false === topPdfCell.drawBottomBorder) {\r\n pdfCell.drawTopBorder = false\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction calculateCoordinates(doc, rows, options) {\r\n var _topLeft$y;\r\n var topLeft = null === options || void 0 === options ? void 0 : options.topLeft;\r\n var margin = null === options || void 0 === options ? void 0 : options.margin;\r\n var y = (null !== (_topLeft$y = null === topLeft || void 0 === topLeft ? void 0 : topLeft.y) && void 0 !== _topLeft$y ? _topLeft$y : 0) + margin.top;\r\n rows.forEach(row => {\r\n var _topLeft$x;\r\n var x = (null !== (_topLeft$x = null === topLeft || void 0 === topLeft ? void 0 : topLeft.x) && void 0 !== _topLeft$x ? _topLeft$x : 0) + margin.left;\r\n var intend = row.indentLevel * options.indent;\r\n row.cells.forEach(cell => {\r\n cell.pdfCell._rect.x = x + intend;\r\n cell.pdfCell._rect.y = y;\r\n x += cell.pdfCell._rect.w\r\n });\r\n y += row.height\r\n })\r\n}\r\n\r\nfunction calculateTableSize(doc, cells, options) {\r\n var _ref2, _leftPos, _options$topLeft, _ref3, _topPos, _options$topLeft2;\r\n var leftPos;\r\n var topPos;\r\n var rightPos;\r\n var bottomPos;\r\n cells.forEach(cell => {\r\n if (!isDefined(leftPos) || leftPos > cell._rect.x) {\r\n leftPos = cell._rect.x\r\n }\r\n if (!isDefined(topPos) || topPos > cell._rect.y) {\r\n topPos = cell._rect.y\r\n }\r\n if (!isDefined(rightPos) || rightPos < cell._rect.x + cell._rect.w) {\r\n rightPos = cell._rect.x + cell._rect.w\r\n }\r\n if (!isDefined(bottomPos) || bottomPos < cell._rect.y + cell._rect.h) {\r\n bottomPos = cell._rect.y + cell._rect.h\r\n }\r\n });\r\n var x = null !== (_ref2 = null !== (_leftPos = leftPos) && void 0 !== _leftPos ? _leftPos : null === options || void 0 === options ? void 0 : null === (_options$topLeft = options.topLeft) || void 0 === _options$topLeft ? void 0 : _options$topLeft.x) && void 0 !== _ref2 ? _ref2 : 0;\r\n var y = null !== (_ref3 = null !== (_topPos = topPos) && void 0 !== _topPos ? _topPos : null === options || void 0 === options ? void 0 : null === (_options$topLeft2 = options.topLeft) || void 0 === _options$topLeft2 ? void 0 : _options$topLeft2.y) && void 0 !== _ref3 ? _ref3 : 0;\r\n var w = isDefined(rightPos) ? rightPos - x : 0;\r\n var h = isDefined(bottomPos) ? bottomPos - y : 0;\r\n return {\r\n x: x,\r\n y: y,\r\n w: w,\r\n h: h\r\n }\r\n}\r\nexport {\r\n initializeCellsWidth,\r\n applyColSpans,\r\n applyRowSpans,\r\n resizeFirstColumnByIndentLevel,\r\n applyBordersConfig,\r\n calculateHeights,\r\n calculateCoordinates,\r\n calculateTableSize\r\n};\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/common/height_updater.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isDefined\r\n} from \"../../../core/utils/type\";\r\nimport {\r\n calculateTextHeight,\r\n calculateTargetRectWidth\r\n} from \"./pdf_utils\";\r\n\r\nfunction updateRowsAndCellsHeights(doc, rows) {\r\n var rowsAdditionalHeights = calculateAdditionalRowsHeights(doc, rows);\r\n rows.forEach(row => {\r\n row.height += rowsAdditionalHeights[row.rowIndex]\r\n });\r\n rows.forEach(row => {\r\n row.cells.forEach(cell => {\r\n var _cell$rowSpan;\r\n var rowsCount = (null !== (_cell$rowSpan = cell.rowSpan) && void 0 !== _cell$rowSpan ? _cell$rowSpan : 0) + 1;\r\n cell.pdfCell._rect.h = rows.slice(row.rowIndex, row.rowIndex + rowsCount).reduce((accumulator, rowInfo) => accumulator + rowInfo.height, 0)\r\n })\r\n })\r\n}\r\n\r\nfunction calculateAdditionalRowsHeights(doc, rows) {\r\n var rowsAdditionalHeights = Array.from({\r\n length: rows.length\r\n }, () => 0);\r\n var sortedRows = sortRowsByMaxRowSpanAsc(rows);\r\n sortedRows.forEach(row => {\r\n var cellsWithRowSpan = row.cells.filter(cell => isDefined(cell.rowSpan));\r\n cellsWithRowSpan.forEach(cell => {\r\n var targetRectWidth = calculateTargetRectWidth(cell.pdfCell._rect.w, cell.pdfCell.padding);\r\n var textHeight = calculateTextHeight(doc, cell.pdfCell.text, cell.pdfCell.font, {\r\n wordWrapEnabled: cell.pdfCell.wordWrapEnabled,\r\n targetRectWidth: targetRectWidth\r\n });\r\n var cellHeight = textHeight + cell.pdfCell.padding.top + cell.pdfCell.padding.bottom;\r\n var rowsCount = cell.rowSpan + 1;\r\n var currentRowSpanRowsHeight = rows.slice(row.rowIndex, row.rowIndex + rowsCount).reduce((accumulator, rowInfo) => accumulator + rowInfo.height + rowsAdditionalHeights[rowInfo.rowIndex], 0);\r\n if (cellHeight > currentRowSpanRowsHeight) {\r\n var delta = (cellHeight - currentRowSpanRowsHeight) / rowsCount;\r\n for (var spanIndex = row.rowIndex; spanIndex < row.rowIndex + rowsCount; spanIndex++) {\r\n rowsAdditionalHeights[spanIndex] += delta\r\n }\r\n }\r\n })\r\n });\r\n return rowsAdditionalHeights\r\n}\r\n\r\nfunction sortRowsByMaxRowSpanAsc(rows) {\r\n var getMaxRowSpan = row => {\r\n var spansArray = row.cells.map(cell => {\r\n var _cell$rowSpan2;\r\n return null !== (_cell$rowSpan2 = cell.rowSpan) && void 0 !== _cell$rowSpan2 ? _cell$rowSpan2 : 0\r\n });\r\n return Math.max(...spansArray)\r\n };\r\n return [...rows].sort((row1, row2) => {\r\n var row1RowSpan = getMaxRowSpan(row1);\r\n var row2RowSpan = getMaxRowSpan(row2);\r\n if (row1RowSpan > row2RowSpan) {\r\n return 1\r\n }\r\n if (row2RowSpan > row1RowSpan) {\r\n return -1\r\n }\r\n return 0\r\n })\r\n}\r\nexport {\r\n updateRowsAndCellsHeights\r\n};\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/common/rows_generator.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\r\nimport {\r\n isDate,\r\n isDefined,\r\n isNumeric\r\n} from \"../../../core/utils/type\";\r\nimport dateLocalization from \"../../../localization/date\";\r\nimport numberLocalization from \"../../../localization/number\";\r\nimport {\r\n toPdfUnit\r\n} from \"./pdf_utils\";\r\nvar defaultStyles = {\r\n base: {\r\n font: {\r\n size: 10\r\n },\r\n borderWidth: .5,\r\n borderColor: \"#979797\"\r\n },\r\n header: {\r\n textColor: \"#979797\"\r\n },\r\n group: {},\r\n data: {},\r\n groupFooter: {},\r\n totalFooter: {}\r\n};\r\n\r\nfunction generateRowsInfo(doc, dataProvider, dataGrid, headerBackgroundColor) {\r\n var result = [];\r\n var rowsCount = dataProvider.getRowsCount();\r\n var wordWrapEnabled = !!dataGrid.option(\"wordWrapEnabled\");\r\n var rtlEnabled = !!dataGrid.option(\"rtlEnabled\");\r\n var columns = dataProvider.getColumns();\r\n var styles = dataProvider.getStyles();\r\n for (var rowIndex = 0; rowIndex < rowsCount; rowIndex++) {\r\n var rowType = dataProvider.getCellData(rowIndex, 0, true).cellSourceData.rowType;\r\n var indentLevel = \"header\" !== rowType ? dataProvider.getGroupLevel(rowIndex) : 0;\r\n var previousRow = result[rowIndex - 1];\r\n if (\"groupFooter\" === rowType && \"groupFooter\" === (null === previousRow || void 0 === previousRow ? void 0 : previousRow.rowType)) {\r\n indentLevel = previousRow.indentLevel - 1\r\n }\r\n result.push({\r\n rowType: rowType,\r\n indentLevel: indentLevel,\r\n cells: generateRowCells({\r\n doc: doc,\r\n dataProvider: dataProvider,\r\n rowIndex: rowIndex,\r\n wordWrapEnabled: wordWrapEnabled,\r\n columns: columns,\r\n styles: styles,\r\n rowType: rowType,\r\n backgroundColor: \"header\" === rowType ? headerBackgroundColor : void 0,\r\n rtlEnabled: rtlEnabled\r\n }),\r\n rowIndex: rowIndex\r\n })\r\n }\r\n return result\r\n}\r\n\r\nfunction generateRowCells(_ref) {\r\n var {\r\n doc: doc,\r\n dataProvider: dataProvider,\r\n rowIndex: rowIndex,\r\n wordWrapEnabled: wordWrapEnabled,\r\n columns: columns,\r\n styles: styles,\r\n rowType: rowType,\r\n backgroundColor: backgroundColor,\r\n rtlEnabled: rtlEnabled\r\n } = _ref;\r\n var result = [];\r\n for (var cellIndex = 0; cellIndex < columns.length; cellIndex++) {\r\n var _style$alignment;\r\n var cellData = dataProvider.getCellData(rowIndex, cellIndex, true);\r\n var cellStyle = styles[dataProvider.getStyleId(rowIndex, cellIndex)];\r\n var style = getPdfCellStyle(columns[cellIndex], rowType, cellStyle);\r\n var defaultAlignment = rtlEnabled ? \"right\" : \"left\";\r\n var paddingValue = toPdfUnit(doc, 5);\r\n var pdfCell = {\r\n text: getFormattedValue(cellData.value, cellStyle.format),\r\n verticalAlign: \"middle\",\r\n horizontalAlign: null !== (_style$alignment = style.alignment) && void 0 !== _style$alignment ? _style$alignment : defaultAlignment,\r\n wordWrapEnabled: wordWrapEnabled,\r\n backgroundColor: backgroundColor,\r\n padding: {\r\n top: paddingValue,\r\n right: paddingValue,\r\n bottom: paddingValue,\r\n left: paddingValue\r\n },\r\n _rect: {},\r\n _internalTextOptions: {}\r\n };\r\n if (rtlEnabled) {\r\n pdfCell._internalTextOptions.isInputVisual = false;\r\n pdfCell._internalTextOptions.isOutputVisual = true;\r\n pdfCell._internalTextOptions.isInputRtl = true;\r\n pdfCell._internalTextOptions.isOutputRtl = false\r\n }\r\n var cellInfo = {\r\n gridCell: cellData.cellSourceData,\r\n pdfCell: _extends({}, pdfCell, style)\r\n };\r\n if (\"header\" === rowType) {\r\n var cellMerging = dataProvider.getCellMerging(rowIndex, cellIndex);\r\n if (cellMerging && cellMerging.rowspan > 0) {\r\n cellInfo.rowSpan = cellMerging.rowspan\r\n }\r\n if (cellMerging && cellMerging.colspan > 0) {\r\n cellInfo.colSpan = cellMerging.colspan\r\n }\r\n } else if (\"group\" === rowType) {\r\n var drawLeftBorderField = rtlEnabled ? \"drawRightBorder\" : \"drawLeftBorder\";\r\n var drawRightBorderField = rtlEnabled ? \"drawLeftBorder\" : \"drawRightBorder\";\r\n cellInfo.pdfCell[drawLeftBorderField] = 0 === cellIndex;\r\n cellInfo.pdfCell[drawRightBorderField] = cellIndex === columns.length - 1;\r\n if (cellIndex > 0) {\r\n var isEmptyCellsExceptFirst = result.slice(1).reduce((accumulate, cellInfo) => accumulate && !isDefined(cellInfo.pdfCell.text), true);\r\n if (!isDefined(cellInfo.pdfCell.text) && isEmptyCellsExceptFirst) {\r\n result[0].pdfCell[drawRightBorderField] = true;\r\n for (var i = 0; i < result.length; i++) {\r\n result[i].colSpan = result.length\r\n }\r\n cellInfo.colSpan = result.length\r\n }\r\n }\r\n }\r\n result.push(cellInfo)\r\n }\r\n return result\r\n}\r\n\r\nfunction getBaseTableStyle() {\r\n return defaultStyles.base\r\n}\r\n\r\nfunction getPdfCellStyle(column, rowType, cellStyle) {\r\n var styles = _extends({}, defaultStyles.base, defaultStyles[rowType]);\r\n var alignment = \"header\" === rowType ? column.alignment : cellStyle.alignment;\r\n if (alignment) {\r\n styles.alignment = alignment\r\n }\r\n if (cellStyle.bold && \"header\" !== rowType) {\r\n styles.font = _extends({}, styles.font, {\r\n style: \"bold\"\r\n })\r\n }\r\n return styles\r\n}\r\n\r\nfunction getFormattedValue(value, format) {\r\n if (isDefined(format)) {\r\n if (isDate(value)) {\r\n return dateLocalization.format(value, format)\r\n }\r\n if (isNumeric(value)) {\r\n return numberLocalization.format(value, format)\r\n }\r\n }\r\n return null === value || void 0 === value ? void 0 : value.toString()\r\n}\r\nexport {\r\n generateRowsInfo,\r\n getBaseTableStyle\r\n};\r\n","/**\r\n * DevExtreme (esm/ui/pivot_grid/ui.pivot_grid.utils.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isNumeric,\r\n isDefined,\r\n type\r\n} from \"../../core/utils/type\";\r\nimport coreAjaxUtils from \"../../core/utils/ajax\";\r\nimport {\r\n compileGetter\r\n} from \"../../core/utils/data\";\r\nimport {\r\n each,\r\n map\r\n} from \"../../core/utils/iterator\";\r\nimport {\r\n extend\r\n} from \"../../core/utils/extend\";\r\nimport localizationDate from \"../../localization/date\";\r\nimport formatHelper from \"../../format_helper\";\r\nimport {\r\n DataSource\r\n} from \"../../data/data_source/data_source\";\r\nimport ArrayStore from \"../../data/array_store\";\r\nimport {\r\n when,\r\n Deferred\r\n} from \"../../core/utils/deferred\";\r\nexport var setFieldProperty = function(field, property, value, isInitialization) {\r\n var initProperties = field._initProperties = field._initProperties || {};\r\n var initValue = isInitialization ? value : field[property];\r\n if (!Object.prototype.hasOwnProperty.call(initProperties, property) || isInitialization) {\r\n initProperties[property] = initValue\r\n }\r\n field[property] = value\r\n};\r\nexport function sendRequest(options) {\r\n return coreAjaxUtils.sendRequest(options)\r\n}\r\nvar foreachTreeAsyncDate = new Date;\r\n\r\nfunction createForeachTreeFunc(isAsync) {\r\n return function foreachTreeFunc(items, callback, parentAtFirst, members, index, isChildrenProcessing) {\r\n members = members || [];\r\n items = items || [];\r\n var i;\r\n var deferred;\r\n index = index || 0;\r\n\r\n function createForeachTreeAsyncHandler(deferred, i, isChildrenProcessing) {\r\n when(foreachTreeFunc(items, callback, parentAtFirst, members, i, isChildrenProcessing)).done(deferred.resolve)\r\n }\r\n for (i = index; i < items.length; i++) {\r\n if (isAsync && i > index && i % 1e4 === 0 && new Date - foreachTreeAsyncDate >= 300) {\r\n foreachTreeAsyncDate = new Date;\r\n deferred = new Deferred;\r\n setTimeout(createForeachTreeAsyncHandler(deferred, i, false), 0);\r\n return deferred\r\n }\r\n var item = items[i];\r\n if (!isChildrenProcessing) {\r\n members.unshift(item);\r\n if (parentAtFirst && false === callback(members, i)) {\r\n return\r\n }\r\n if (item.children) {\r\n var childrenDeferred = foreachTreeFunc(item.children, callback, parentAtFirst, members);\r\n if (isAsync && childrenDeferred) {\r\n deferred = new Deferred;\r\n childrenDeferred.done(createForeachTreeAsyncHandler(deferred, i, true));\r\n return deferred\r\n }\r\n }\r\n }\r\n isChildrenProcessing = false;\r\n if (!parentAtFirst && false === callback(members, i)) {\r\n return\r\n }\r\n members.shift();\r\n if (items[i] !== item) {\r\n i--\r\n }\r\n }\r\n }\r\n}\r\nexport var foreachTree = createForeachTreeFunc(false);\r\nexport var foreachTreeAsync = createForeachTreeFunc(true);\r\nexport function findField(fields, id) {\r\n if (fields && isDefined(id)) {\r\n for (var i = 0; i < fields.length; i++) {\r\n var field = fields[i];\r\n if (field.name === id || field.caption === id || field.dataField === id || field.index === id) {\r\n return i\r\n }\r\n }\r\n }\r\n return -1\r\n}\r\nexport function formatValue(value, options) {\r\n var valueText = value === value && formatHelper.format(value, options.format);\r\n var formatObject = {\r\n value: value,\r\n valueText: valueText || \"\"\r\n };\r\n return options.customizeText ? options.customizeText.call(options, formatObject) : formatObject.valueText\r\n}\r\nexport function getCompareFunction(valueSelector) {\r\n return function(a, b) {\r\n var result = 0;\r\n var valueA = valueSelector(a);\r\n var valueB = valueSelector(b);\r\n var aIsDefined = isDefined(valueA);\r\n var bIsDefined = isDefined(valueB);\r\n if (aIsDefined && bIsDefined) {\r\n if (valueA > valueB) {\r\n result = 1\r\n } else if (valueA < valueB) {\r\n result = -1\r\n }\r\n }\r\n if (aIsDefined && !bIsDefined) {\r\n result = 1\r\n }\r\n if (!aIsDefined && bIsDefined) {\r\n result = -1\r\n }\r\n return result\r\n }\r\n}\r\nexport function createPath(items) {\r\n var result = [];\r\n for (var i = items.length - 1; i >= 0; i--) {\r\n result.push(items[i].key || items[i].value)\r\n }\r\n return result\r\n}\r\nexport function foreachDataLevel(data, callback, index, childrenField) {\r\n index = index || 0;\r\n childrenField = childrenField || \"children\";\r\n if (data.length) {\r\n callback(data, index)\r\n }\r\n for (var i = 0; i < data.length; i++) {\r\n var item = data[i];\r\n if (item[childrenField] && item[childrenField].length) {\r\n foreachDataLevel(item[childrenField], callback, index + 1, childrenField)\r\n }\r\n }\r\n}\r\nexport function mergeArraysByMaxValue(values1, values2) {\r\n var result = [];\r\n for (var i = 0; i < values1.length; i++) {\r\n result.push(Math.max(values1[i] || 0, values2[i] || 0))\r\n }\r\n return result\r\n}\r\nexport function getExpandedLevel(options, axisName) {\r\n var dimensions = options[axisName];\r\n var expandLevel = 0;\r\n var expandedPaths = (\"columns\" === axisName ? options.columnExpandedPaths : options.rowExpandedPaths) || [];\r\n if (options.headerName === axisName) {\r\n expandLevel = options.path.length\r\n } else if (options.headerName && options.headerName !== axisName && options.oppositePath) {\r\n expandLevel = options.oppositePath.length\r\n } else {\r\n each(expandedPaths, (function(_, path) {\r\n expandLevel = Math.max(expandLevel, path.length)\r\n }))\r\n }\r\n while (dimensions[expandLevel + 1] && dimensions[expandLevel].expanded) {\r\n expandLevel++\r\n }\r\n return expandLevel\r\n}\r\n\r\nfunction createGroupFields(item) {\r\n return map([\"year\", \"quarter\", \"month\"], (function(value, index) {\r\n return extend({}, item, {\r\n groupInterval: value,\r\n groupIndex: index\r\n })\r\n }))\r\n}\r\n\r\nfunction parseFields(dataSource, fieldsList, path, fieldsDataType) {\r\n var result = [];\r\n Object.keys(fieldsList || []).forEach((function(field) {\r\n if (field && 0 === field.indexOf(\"__\")) {\r\n return\r\n }\r\n var dataIndex = 1;\r\n var currentPath = path.length ? path + \".\" + field : field;\r\n var dataType = fieldsDataType[currentPath];\r\n var getter = compileGetter(currentPath);\r\n var value = fieldsList[field];\r\n var items;\r\n while (!isDefined(value) && dataSource[dataIndex]) {\r\n value = getter(dataSource[dataIndex]);\r\n dataIndex++\r\n }\r\n if (!dataType && isDefined(value)) {\r\n dataType = type(value)\r\n }\r\n items = [{\r\n dataField: currentPath,\r\n dataType: dataType,\r\n groupName: \"date\" === dataType ? field : void 0,\r\n groupInterval: void 0,\r\n displayFolder: path\r\n }];\r\n if (\"date\" === dataType) {\r\n items = items.concat(createGroupFields(items[0]))\r\n } else if (\"object\" === dataType) {\r\n items = parseFields(dataSource, value, currentPath, fieldsDataType)\r\n }\r\n result.push.apply(result, items)\r\n }));\r\n return result\r\n}\r\nexport function discoverObjectFields(items, fields) {\r\n var fieldsDataType = getFieldsDataType(fields);\r\n return parseFields(items, items[0], \"\", fieldsDataType)\r\n}\r\nexport function getFieldsDataType(fields) {\r\n var result = {};\r\n each(fields, (function(_, field) {\r\n result[field.dataField] = result[field.dataField] || field.dataType\r\n }));\r\n return result\r\n}\r\nvar DATE_INTERVAL_FORMATS = {\r\n month: function(value) {\r\n return localizationDate.getMonthNames()[value - 1]\r\n },\r\n quarter: function(value) {\r\n return localizationDate.format(new Date(2e3, 3 * value - 1), \"quarter\")\r\n },\r\n dayOfWeek: function(value) {\r\n return localizationDate.getDayNames()[value]\r\n }\r\n};\r\nexport function setDefaultFieldValueFormatting(field) {\r\n if (\"date\" === field.dataType) {\r\n if (!field.format) {\r\n setFieldProperty(field, \"format\", DATE_INTERVAL_FORMATS[field.groupInterval])\r\n }\r\n } else if (\"number\" === field.dataType) {\r\n var groupInterval = isNumeric(field.groupInterval) && field.groupInterval > 0 && field.groupInterval;\r\n if (groupInterval && !field.customizeText) {\r\n setFieldProperty(field, \"customizeText\", (function(formatObject) {\r\n var secondValue = formatObject.value + groupInterval;\r\n var secondValueText = formatHelper.format(secondValue, field.format);\r\n return formatObject.valueText && secondValueText ? formatObject.valueText + \" - \" + secondValueText : \"\"\r\n }))\r\n }\r\n }\r\n}\r\nexport function getFiltersByPath(fields, path) {\r\n var result = [];\r\n path = path || [];\r\n for (var i = 0; i < path.length; i++) {\r\n result.push(extend({}, fields[i], {\r\n groupIndex: null,\r\n groupName: null,\r\n filterType: \"include\",\r\n filterValues: [path[i]]\r\n }))\r\n }\r\n return result\r\n}\r\nexport var storeDrillDownMixin = {\r\n createDrillDownDataSource: function(descriptions, params) {\r\n var items = this.getDrillDownItems(descriptions, params);\r\n\r\n function createCustomStoreMethod(methodName) {\r\n return function(options) {\r\n var d;\r\n if (void 0) {\r\n d = (void 0)[methodName](options)\r\n } else {\r\n d = new Deferred;\r\n when(items).done((function(data) {\r\n var arrayStore = new ArrayStore(data);\r\n arrayStore[methodName](options).done(d.resolve).fail(d.reject)\r\n })).fail(d.reject)\r\n }\r\n return d\r\n }\r\n }\r\n var dataSource = new DataSource({\r\n load: createCustomStoreMethod(\"load\"),\r\n totalCount: createCustomStoreMethod(\"totalCount\"),\r\n key: this.key()\r\n });\r\n return dataSource\r\n }\r\n};\r\nexport function capitalizeFirstLetter(string) {\r\n return string.charAt(0).toUpperCase() + string.slice(1)\r\n}\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/common/draw_utils.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\r\nvar _excluded = [\"_rect\", \"gridCell\"];\r\nimport {\r\n isDefined\r\n} from \"../../../core/utils/type\";\r\nimport {\r\n extend\r\n} from \"../../../core/utils/extend\";\r\nimport {\r\n calculateTextHeight,\r\n toPdfUnit\r\n} from \"./pdf_utils\";\r\nimport {\r\n capitalizeFirstLetter\r\n} from \"../../../ui/pivot_grid/ui.pivot_grid.utils\";\r\n\r\nfunction roundToThreeDecimals(value) {\r\n return Math.round(1e3 * value) / 1e3\r\n}\r\n\r\nfunction drawCellsContent(doc, customDrawCell, cellsArray, docStyles) {\r\n cellsArray.forEach(cell => {\r\n var {\r\n _rect: _rect,\r\n gridCell: gridCell\r\n } = cell, pdfCell = _objectWithoutPropertiesLoose(cell, _excluded);\r\n var {\r\n x: x,\r\n y: y,\r\n w: w,\r\n h: h\r\n } = _rect;\r\n var rect = {\r\n x: x,\r\n y: y,\r\n w: w,\r\n h: h\r\n };\r\n var eventArg = {\r\n doc: doc,\r\n rect: rect,\r\n pdfCell: pdfCell,\r\n gridCell: gridCell,\r\n cancel: false\r\n };\r\n null === customDrawCell || void 0 === customDrawCell ? void 0 : customDrawCell(eventArg);\r\n if (!eventArg.cancel) {\r\n drawCellBackground(doc, cell);\r\n drawCellText(doc, cell, docStyles)\r\n }\r\n })\r\n}\r\n\r\nfunction drawLine(doc, startX, startY, endX, endY) {\r\n doc.line(roundToThreeDecimals(startX), roundToThreeDecimals(startY), roundToThreeDecimals(endX), roundToThreeDecimals(endY))\r\n}\r\n\r\nfunction drawRect(doc, x, y, width, height, style) {\r\n if (isDefined(style)) {\r\n doc.rect(roundToThreeDecimals(x), roundToThreeDecimals(y), roundToThreeDecimals(width), roundToThreeDecimals(height), style)\r\n } else {\r\n doc.rect(roundToThreeDecimals(x), roundToThreeDecimals(y), roundToThreeDecimals(width), roundToThreeDecimals(height))\r\n }\r\n}\r\n\r\nfunction getLineHeightShift(doc) {\r\n return (doc.getLineHeightFactor() - 1.15) * doc.getFontSize()\r\n}\r\n\r\nfunction drawTextInRect(doc, text, rect, verticalAlign, horizontalAlign, jsPDFTextOptions) {\r\n var textArray = text.split(\"\\n\");\r\n var linesCount = textArray.length;\r\n var heightOfOneLine = calculateTextHeight(doc, textArray[0], doc.getFont(), {\r\n wordWrapEnabled: false,\r\n targetRectWidth: 1e9\r\n });\r\n var vAlign = null !== verticalAlign && void 0 !== verticalAlign ? verticalAlign : \"middle\";\r\n var hAlign = null !== horizontalAlign && void 0 !== horizontalAlign ? horizontalAlign : \"left\";\r\n var verticalAlignCoefficientsMap = {\r\n top: 0,\r\n middle: .5,\r\n bottom: 1\r\n };\r\n var y = rect.y + rect.h * verticalAlignCoefficientsMap[vAlign] - heightOfOneLine * (linesCount - 1) * verticalAlignCoefficientsMap[vAlign] + getLineHeightShift(doc);\r\n var x = rect.x + rect.w * {\r\n left: 0,\r\n center: .5,\r\n right: 1\r\n } [hAlign];\r\n var textOptions = extend({\r\n baseline: vAlign,\r\n align: hAlign\r\n }, jsPDFTextOptions);\r\n doc.text(textArray.join(\"\\n\"), roundToThreeDecimals(x), roundToThreeDecimals(y), textOptions)\r\n}\r\n\r\nfunction drawCellBackground(doc, cell) {\r\n if (isDefined(cell.backgroundColor)) {\r\n trySetColor(doc, \"fill\", cell.backgroundColor);\r\n drawRect(doc, cell._rect.x, cell._rect.y, cell._rect.w, cell._rect.h, \"F\")\r\n }\r\n}\r\n\r\nfunction drawCellText(doc, cell, docStyles) {\r\n if (isDefined(cell.text) && \"\" !== cell.text) {\r\n var {\r\n textColor: textColor,\r\n font: font,\r\n _rect: _rect,\r\n padding: padding\r\n } = cell;\r\n setTextStyles(doc, {\r\n textColor: textColor,\r\n font: font\r\n }, docStyles);\r\n var textRect = {\r\n x: _rect.x + padding.left,\r\n y: _rect.y + padding.top,\r\n w: _rect.w - (padding.left + padding.right),\r\n h: _rect.h - (padding.top + padding.bottom)\r\n };\r\n if (isDefined(cell._textLeftOffset) || isDefined(cell._textTopOffset)) {\r\n var _cell$_textLeftOffset, _cell$_textTopOffset;\r\n textRect.x = textRect.x + (null !== (_cell$_textLeftOffset = cell._textLeftOffset) && void 0 !== _cell$_textLeftOffset ? _cell$_textLeftOffset : 0);\r\n textRect.y = textRect.y + (null !== (_cell$_textTopOffset = cell._textTopOffset) && void 0 !== _cell$_textTopOffset ? _cell$_textTopOffset : 0);\r\n doc.saveGraphicsState();\r\n clipOutsideRectContent(doc, cell._rect.x, cell._rect.y, cell._rect.w, cell._rect.h)\r\n }\r\n drawTextInRect(doc, cell.text, textRect, cell.verticalAlign, cell.horizontalAlign, cell._internalTextOptions);\r\n if (isDefined(cell._textLeftOffset) || isDefined(cell._textTopOffset)) {\r\n doc.restoreGraphicsState()\r\n }\r\n }\r\n}\r\n\r\nfunction drawCellsLines(doc, cellsArray, docStyles) {\r\n cellsArray.filter(cell => !isDefined(cell.borderColor)).forEach(cell => {\r\n drawBorders(doc, cell._rect, cell, docStyles)\r\n });\r\n cellsArray.filter(cell => isDefined(cell.borderColor)).forEach(cell => {\r\n drawBorders(doc, cell._rect, cell, docStyles)\r\n })\r\n}\r\n\r\nfunction drawGridLines(doc, rect, options, docStyles) {\r\n drawBorders(doc, rect, options, docStyles)\r\n}\r\n\r\nfunction drawBorders(doc, rect, _ref, docStyles) {\r\n var {\r\n borderWidth: borderWidth,\r\n borderColor: borderColor,\r\n drawLeftBorder: drawLeftBorder = true,\r\n drawRightBorder: drawRightBorder = true,\r\n drawTopBorder: drawTopBorder = true,\r\n drawBottomBorder: drawBottomBorder = true\r\n } = _ref;\r\n if (!isDefined(rect)) {\r\n throw \"rect is required\"\r\n }\r\n if (!drawLeftBorder && !drawRightBorder && !drawTopBorder && !drawBottomBorder) {\r\n return\r\n } else if (drawLeftBorder && drawRightBorder && drawTopBorder && drawBottomBorder) {\r\n setLinesStyles(doc, {\r\n borderWidth: borderWidth,\r\n borderColor: borderColor\r\n }, docStyles);\r\n drawRect(doc, rect.x, rect.y, rect.w, rect.h)\r\n } else {\r\n setLinesStyles(doc, {\r\n borderWidth: borderWidth,\r\n borderColor: borderColor\r\n }, docStyles);\r\n if (drawTopBorder) {\r\n drawLine(doc, rect.x, rect.y, rect.x + rect.w, rect.y)\r\n }\r\n if (drawLeftBorder) {\r\n drawLine(doc, rect.x, rect.y, rect.x, rect.y + rect.h)\r\n }\r\n if (drawRightBorder) {\r\n drawLine(doc, rect.x + rect.w, rect.y, rect.x + rect.w, rect.y + rect.h)\r\n }\r\n if (drawBottomBorder) {\r\n drawLine(doc, rect.x, rect.y + rect.h, rect.x + rect.w, rect.y + rect.h)\r\n }\r\n }\r\n}\r\n\r\nfunction setTextStyles(doc, _ref2, docStyles) {\r\n var {\r\n textColor: textColor,\r\n font: font\r\n } = _ref2;\r\n trySetColor(doc, \"text\", isDefined(textColor) ? textColor : docStyles.textColor);\r\n var currentFont = isDefined(font) ? extend({}, docStyles.font, font) : docStyles.font;\r\n var docFont = doc.getFont();\r\n if (currentFont.name !== docFont.fontName || currentFont.style !== docFont.fontStyle || isDefined(currentFont.weight)) {\r\n doc.setFont(currentFont.name, currentFont.style, currentFont.weight)\r\n }\r\n if (currentFont.size !== doc.getFontSize()) {\r\n doc.setFontSize(currentFont.size)\r\n }\r\n}\r\n\r\nfunction setLinesStyles(doc, _ref3, docStyles) {\r\n var {\r\n borderWidth: borderWidth,\r\n borderColor: borderColor\r\n } = _ref3;\r\n var currentBorderWidth = isDefined(borderWidth) ? borderWidth : docStyles.borderWidth;\r\n if (currentBorderWidth !== getDocBorderWidth(doc)) {\r\n setDocBorderWidth(doc, toPdfUnit(doc, currentBorderWidth))\r\n }\r\n trySetColor(doc, \"draw\", isDefined(borderColor) ? borderColor : docStyles.borderColor)\r\n}\r\n\r\nfunction trySetColor(doc, target, color) {\r\n var getterName = \"get\".concat(capitalizeFirstLetter(target), \"Color\");\r\n var setterName = \"set\".concat(capitalizeFirstLetter(target), \"Color\");\r\n var {\r\n ch1: ch1 = color,\r\n ch2: ch2,\r\n ch3: ch3,\r\n ch4: ch4\r\n } = color;\r\n var normalizedColor = doc.__private__.decodeColorString(doc.__private__.encodeColorString({\r\n ch1: ch1,\r\n ch2: ch2,\r\n ch3: ch3,\r\n ch4: ch4,\r\n precision: \"text\" === target ? 3 : 2\r\n }));\r\n if (normalizedColor !== doc[getterName]() || \"fill\" === target) {\r\n doc[setterName].apply(doc, [ch1, ch2, ch3, ch4].filter(item => void 0 !== item))\r\n }\r\n}\r\n\r\nfunction getDocumentStyles(doc) {\r\n var docFont = doc.getFont();\r\n return {\r\n borderWidth: getDocBorderWidth(doc),\r\n borderColor: doc.getDrawColor(),\r\n font: {\r\n name: docFont.fontName,\r\n style: docFont.fontStyle,\r\n size: doc.getFontSize()\r\n },\r\n textColor: doc.getTextColor()\r\n }\r\n}\r\n\r\nfunction setDocumentStyles(doc, styles) {\r\n var {\r\n borderWidth: borderWidth,\r\n borderColor: borderColor,\r\n font: font,\r\n textColor: textColor\r\n } = styles;\r\n var docFont = doc.getFont();\r\n if (docFont.fontName !== font.name || docFont.fontStyle !== font.style) {\r\n doc.setFont(font.name, font.style, void 0)\r\n }\r\n var docFontSize = doc.getFontSize();\r\n if (docFontSize !== font.size) {\r\n doc.setFontSize(font.size)\r\n }\r\n if (getDocBorderWidth(doc) !== borderWidth) {\r\n setDocBorderWidth(doc, borderWidth)\r\n }\r\n if (doc.getDrawColor() !== borderColor) {\r\n doc.setDrawColor(borderColor)\r\n }\r\n if (doc.getTextColor() !== textColor) {\r\n doc.setTextColor(textColor)\r\n }\r\n}\r\n\r\nfunction addNewPage(doc) {\r\n doc.addPage();\r\n resetDocBorderWidth(doc)\r\n}\r\n\r\nfunction getDocBorderWidth(doc) {\r\n var _doc$__borderWidth;\r\n if (isDefined(doc.getLineWidth)) {\r\n return doc.getLineWidth()\r\n }\r\n return null !== (_doc$__borderWidth = doc.__borderWidth) && void 0 !== _doc$__borderWidth ? _doc$__borderWidth : .200025\r\n}\r\n\r\nfunction setDocBorderWidth(doc, width) {\r\n doc.setLineWidth(width);\r\n if (!isDefined(doc.getLineWidth)) {\r\n doc.__borderWidth = width\r\n }\r\n}\r\n\r\nfunction resetDocBorderWidth(doc) {\r\n if (!isDefined(doc.getLineWidth)) {\r\n doc.__borderWidth = null\r\n }\r\n}\r\n\r\nfunction clipOutsideRectContent(doc, x, y, w, h) {\r\n doc.moveTo(roundToThreeDecimals(x), roundToThreeDecimals(y));\r\n doc.lineTo(roundToThreeDecimals(x + w), roundToThreeDecimals(y));\r\n doc.lineTo(roundToThreeDecimals(x + w), roundToThreeDecimals(y + h));\r\n doc.lineTo(roundToThreeDecimals(x), roundToThreeDecimals(y + h));\r\n doc.clip();\r\n doc.discardPath()\r\n}\r\nexport {\r\n drawCellsContent,\r\n drawCellsLines,\r\n drawGridLines,\r\n getDocumentStyles,\r\n setDocumentStyles,\r\n drawTextInRect,\r\n drawRect,\r\n drawLine,\r\n roundToThreeDecimals,\r\n addNewPage\r\n};\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/common/rows_splitting.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\r\nimport {\r\n isDefined\r\n} from \"../../../core/utils/type\";\r\nimport {\r\n getPageWidth,\r\n getPageHeight\r\n} from \"./pdf_utils\";\r\nimport {\r\n roundToThreeDecimals\r\n} from \"./draw_utils\";\r\n\r\nfunction convertToCellsArray(rows) {\r\n return [].concat.apply([], rows.map(rowInfo => rowInfo.cells.filter(cell => !isDefined(cell.pdfCell.isMerged)).map(cellInfo => _extends({}, cellInfo.pdfCell._rect, {\r\n sourceCellInfo: _extends({}, cellInfo.pdfCell, {\r\n gridCell: cellInfo.gridCell\r\n })\r\n }))))\r\n}\r\n\r\nfunction splitByPages(doc, rowsInfo, options, onSeparateRectHorizontally, onSeparateRectVertically) {\r\n if (0 === rowsInfo.length) {\r\n return [\r\n []\r\n ]\r\n }\r\n var maxBottomRight = {\r\n x: getPageWidth(doc) - options.margin.right,\r\n y: getPageHeight(doc) - options.margin.bottom\r\n };\r\n var headerRows = rowsInfo.filter(r => \"header\" === r.rowType);\r\n var headerHeight = headerRows.reduce((accumulator, row) => accumulator + row.height, 0);\r\n var verticallyPages = splitRectsByPages(convertToCellsArray(rowsInfo), options.margin.top, \"y\", \"h\", (pagesLength, currentCoordinate) => {\r\n var additionalHeight = pagesLength > 0 && options.repeatHeaders ? headerHeight : 0;\r\n return roundToThreeDecimals(currentCoordinate + additionalHeight) <= roundToThreeDecimals(maxBottomRight.y)\r\n }, (rect, currentPageMaxRectCoordinate, currentPageRects, rectsToSplit) => {\r\n var args = {\r\n sourceRect: rect,\r\n topRect: {\r\n x: rect.x,\r\n y: rect.y,\r\n w: rect.w,\r\n h: currentPageMaxRectCoordinate - rect.y\r\n },\r\n bottomRect: {\r\n x: rect.x,\r\n y: currentPageMaxRectCoordinate,\r\n w: rect.w,\r\n h: rect.h - (currentPageMaxRectCoordinate - rect.y)\r\n }\r\n };\r\n onSeparateRectVertically(args);\r\n currentPageRects.push(args.topRect);\r\n rectsToSplit.push(args.bottomRect)\r\n });\r\n if (options.repeatHeaders) {\r\n for (var i = 1; i < verticallyPages.length; i++) {\r\n verticallyPages[i].forEach(rect => rect.y += headerHeight);\r\n var headerCells = convertToCellsArray(headerRows);\r\n headerCells.forEach(cell => {\r\n cell.y -= options.topLeft.y\r\n });\r\n verticallyPages[i] = [...headerCells, ...verticallyPages[i]]\r\n }\r\n }\r\n var pageIndex = 0;\r\n while (pageIndex < verticallyPages.length) {\r\n var horizontallyPages = splitRectsByPages(verticallyPages[pageIndex], options.margin.left, \"x\", \"w\", (pagesLength, currentCoordinate) => roundToThreeDecimals(currentCoordinate) <= roundToThreeDecimals(maxBottomRight.x), (rect, currentPageMaxRectCoordinate, currentPageRects, rectsToSplit) => {\r\n var args = {\r\n sourceRect: rect,\r\n leftRect: {\r\n x: rect.x,\r\n y: rect.y,\r\n w: currentPageMaxRectCoordinate - rect.x,\r\n h: rect.h\r\n },\r\n rightRect: {\r\n x: currentPageMaxRectCoordinate,\r\n y: rect.y,\r\n w: rect.w - (currentPageMaxRectCoordinate - rect.x),\r\n h: rect.h\r\n }\r\n };\r\n onSeparateRectHorizontally(args);\r\n currentPageRects.push(args.leftRect);\r\n rectsToSplit.push(args.rightRect)\r\n });\r\n if (horizontallyPages.length > 1) {\r\n verticallyPages.splice(pageIndex, 1, ...horizontallyPages);\r\n pageIndex += horizontallyPages.length\r\n } else {\r\n pageIndex += 1\r\n }\r\n }\r\n return verticallyPages.map(rects => rects.map(rect => _extends({}, rect.sourceCellInfo, {\r\n _rect: rect\r\n })))\r\n}\r\n\r\nfunction splitRectsByPages(rects, marginValue, coordinate, dimension, checkPredicate, onSeparateCallback) {\r\n var pages = [];\r\n var rectsToSplit = [...rects];\r\n var _loop = function() {\r\n var currentPageMaxRectCoordinate = 0;\r\n var currentPageRects = rectsToSplit.filter(rect => {\r\n var currentRectCoordinate = rect[coordinate] + rect[dimension];\r\n if (checkPredicate(pages.length, currentRectCoordinate)) {\r\n if (currentPageMaxRectCoordinate <= currentRectCoordinate) {\r\n currentPageMaxRectCoordinate = currentRectCoordinate\r\n }\r\n return true\r\n } else {\r\n return false\r\n }\r\n });\r\n var rectsToSeparate = rectsToSplit.filter(rect => {\r\n var currentRectLeft = rect[coordinate];\r\n var currentRectRight = rect[coordinate] + rect[dimension];\r\n if (currentRectLeft < currentPageMaxRectCoordinate && currentPageMaxRectCoordinate < currentRectRight) {\r\n return true\r\n }\r\n });\r\n rectsToSeparate.forEach(rect => {\r\n onSeparateCallback(rect, currentPageMaxRectCoordinate, currentPageRects, rectsToSplit);\r\n var index = rectsToSplit.indexOf(rect);\r\n if (-1 !== index) {\r\n rectsToSplit.splice(index, 1)\r\n }\r\n });\r\n currentPageRects.forEach(rect => {\r\n var index = rectsToSplit.indexOf(rect);\r\n if (-1 !== index) {\r\n rectsToSplit.splice(index, 1)\r\n }\r\n });\r\n rectsToSplit.forEach(rect => {\r\n rect[coordinate] = isDefined(currentPageMaxRectCoordinate) ? rect[coordinate] - currentPageMaxRectCoordinate + marginValue : rect[coordinate]\r\n });\r\n if (currentPageRects.length > 0) {\r\n pages.push(currentPageRects)\r\n } else {\r\n pages.push(rectsToSplit);\r\n return \"break\"\r\n }\r\n };\r\n while (rectsToSplit.length > 0) {\r\n var _ret = _loop();\r\n if (\"break\" === _ret) {\r\n break\r\n }\r\n }\r\n return pages\r\n}\r\nexport {\r\n splitByPages\r\n};\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/common/export.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\r\nimport {\r\n isDefined\r\n} from \"../../../core/utils/type\";\r\nimport {\r\n extend\r\n} from \"../../../core/utils/extend\";\r\nimport {\r\n normalizeRowsInfo,\r\n normalizeBoundaryValue\r\n} from \"./normalizeOptions\";\r\nimport {\r\n initializeCellsWidth,\r\n applyColSpans,\r\n applyRowSpans,\r\n applyBordersConfig,\r\n calculateHeights,\r\n calculateCoordinates,\r\n calculateTableSize,\r\n resizeFirstColumnByIndentLevel\r\n} from \"./row_utils\";\r\nimport {\r\n updateRowsAndCellsHeights\r\n} from \"./height_updater\";\r\nimport {\r\n generateRowsInfo,\r\n getBaseTableStyle\r\n} from \"./rows_generator\";\r\nimport {\r\n splitByPages\r\n} from \"./rows_splitting\";\r\nimport {\r\n drawCellsContent,\r\n drawCellsLines,\r\n drawGridLines,\r\n getDocumentStyles,\r\n setDocumentStyles,\r\n addNewPage\r\n} from \"./draw_utils\";\r\nimport {\r\n applyRtl,\r\n applyWordWrap,\r\n toPdfUnit\r\n} from \"./pdf_utils\";\r\nimport messageLocalization from \"../../../localization/message\";\r\nimport {\r\n ExportLoadPanel\r\n} from \"../../common/export_load_panel\";\r\nimport {\r\n hasWindow\r\n} from \"../../../core/utils/window\";\r\n\r\nfunction _getFullOptions(options) {\r\n var {\r\n jsPDFDocument: jsPDFDocument\r\n } = options;\r\n var fullOptions = extend({}, options);\r\n if (!isDefined(fullOptions.topLeft)) {\r\n fullOptions.topLeft = {\r\n x: 0,\r\n y: 0\r\n }\r\n }\r\n if (!isDefined(fullOptions.indent)) {\r\n fullOptions.indent = 0\r\n }\r\n if (!isDefined(fullOptions.repeatHeaders)) {\r\n fullOptions.repeatHeaders = true\r\n }\r\n if (!isDefined(fullOptions.margin)) {\r\n fullOptions.margin = toPdfUnit(jsPDFDocument, 40)\r\n }\r\n fullOptions.margin = normalizeBoundaryValue(fullOptions.margin);\r\n if (!Array.isArray(fullOptions.columnWidths)) {\r\n fullOptions.columnWidths = []\r\n }\r\n if (!isDefined(fullOptions.loadPanel)) {\r\n fullOptions.loadPanel = {}\r\n }\r\n if (!isDefined(fullOptions.loadPanel.enabled)) {\r\n fullOptions.loadPanel.enabled = true\r\n }\r\n if (!isDefined(fullOptions.loadPanel.text)) {\r\n fullOptions.loadPanel.text = messageLocalization.format(\"dxDataGrid-exporting\")\r\n }\r\n return fullOptions\r\n}\r\n\r\nfunction exportDataGrid(options) {\r\n var _component$_getIntern;\r\n var {\r\n jsPDFDocument: jsPDFDocument,\r\n component: component,\r\n selectedRowsOnly: selectedRowsOnly,\r\n loadPanel: loadPanel\r\n } = options;\r\n var internalComponent = (null === (_component$_getIntern = component._getInternalInstance) || void 0 === _component$_getIntern ? void 0 : _component$_getIntern.call(component)) || component;\r\n var initialLoadPanelEnabledOption = internalComponent.option(\"loadPanel\") && internalComponent.option(\"loadPanel\").enabled;\r\n if (initialLoadPanelEnabledOption) {\r\n component.option(\"loadPanel.enabled\", false)\r\n }\r\n var exportLoadPanel;\r\n if (loadPanel.enabled && hasWindow()) {\r\n var rowsView = component.getView(\"rowsView\");\r\n exportLoadPanel = new ExportLoadPanel(component, rowsView.element(), rowsView.element().parent(), loadPanel);\r\n exportLoadPanel.show()\r\n }\r\n var dataProvider = component.getDataProvider(selectedRowsOnly);\r\n return new Promise(resolve => {\r\n dataProvider.ready().done(() => {\r\n var _options$rowOptions, _options$rowOptions$h;\r\n var rowsInfo = generateRowsInfo(jsPDFDocument, dataProvider, component, null === (_options$rowOptions = options.rowOptions) || void 0 === _options$rowOptions ? void 0 : null === (_options$rowOptions$h = _options$rowOptions.headerStyles) || void 0 === _options$rowOptions$h ? void 0 : _options$rowOptions$h.backgroundColor);\r\n if (options.customizeCell) {\r\n rowsInfo.forEach(rowInfo => rowInfo.cells.forEach(cellInfo => options.customizeCell(cellInfo)))\r\n }\r\n normalizeRowsInfo(rowsInfo);\r\n initializeCellsWidth(jsPDFDocument, dataProvider, rowsInfo, options);\r\n resizeFirstColumnByIndentLevel(rowsInfo, options);\r\n applyColSpans(rowsInfo);\r\n calculateHeights(jsPDFDocument, rowsInfo, options);\r\n applyRowSpans(rowsInfo);\r\n updateRowsAndCellsHeights(jsPDFDocument, rowsInfo);\r\n calculateCoordinates(jsPDFDocument, rowsInfo, options);\r\n applyBordersConfig(rowsInfo);\r\n applyWordWrap(jsPDFDocument, rowsInfo);\r\n var docStyles = getDocumentStyles(jsPDFDocument);\r\n var rtlEnabled = !!component.option(\"rtlEnabled\");\r\n var rectsByPages = splitByPages(jsPDFDocument, rowsInfo, options, _ref => {\r\n var _sourceRect$sourceCel;\r\n var {\r\n sourceRect: sourceRect,\r\n leftRect: leftRect,\r\n rightRect: rightRect\r\n } = _ref;\r\n var leftRectTextOptions = {};\r\n var rightRectTextOptions = {};\r\n var isTextNotEmpty = (null === (_sourceRect$sourceCel = sourceRect.sourceCellInfo.text) || void 0 === _sourceRect$sourceCel ? void 0 : _sourceRect$sourceCel.length) > 0;\r\n if (isTextNotEmpty) {\r\n if (rtlEnabled) {\r\n var isTextWidthGreaterThanRect = jsPDFDocument.getTextWidth(sourceRect.sourceCellInfo.text) > leftRect.w;\r\n var isTextRightAlignment = !isDefined(sourceRect.sourceCellInfo.horizontalAlign) || \"right\" === sourceRect.sourceCellInfo.horizontalAlign;\r\n if (isTextWidthGreaterThanRect || !isTextRightAlignment) {\r\n var _sourceRect$sourceCel2, _sourceRect$sourceCel4, _sourceRect$sourceCel5;\r\n var rightRectTextOffset;\r\n var leftRectTextOffset;\r\n if (\"right\" === (null === (_sourceRect$sourceCel2 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel2 ? void 0 : _sourceRect$sourceCel2.horizontalAlign)) {\r\n var _sourceRect$sourceCel3;\r\n rightRectTextOffset = null !== (_sourceRect$sourceCel3 = sourceRect.sourceCellInfo._textLeftOffset) && void 0 !== _sourceRect$sourceCel3 ? _sourceRect$sourceCel3 : 0;\r\n leftRectTextOffset = rightRectTextOffset + leftRect.w\r\n } else if (\"center\" === (null === (_sourceRect$sourceCel4 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel4 ? void 0 : _sourceRect$sourceCel4.horizontalAlign)) {\r\n leftRectTextOffset = sourceRect.x + sourceRect.w - (rightRect.x + rightRect.w) + sourceRect.sourceCellInfo._rect.w / 2 - leftRect.w / 2;\r\n rightRectTextOffset = leftRectTextOffset - rightRect.w\r\n } else if (\"left\" === (null === (_sourceRect$sourceCel5 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel5 ? void 0 : _sourceRect$sourceCel5.horizontalAlign)) {\r\n leftRectTextOffset = sourceRect.x + sourceRect.w - (rightRect.x + rightRect.w);\r\n rightRectTextOffset = leftRectTextOffset - rightRect.w\r\n }\r\n leftRectTextOptions = _extends({}, {\r\n _textLeftOffset: rightRectTextOffset\r\n });\r\n rightRectTextOptions = _extends({}, {\r\n _textLeftOffset: leftRectTextOffset\r\n })\r\n } else {\r\n rightRectTextOptions = _extends({}, {\r\n text: \"\"\r\n })\r\n }\r\n } else {\r\n var _isTextWidthGreaterThanRect = jsPDFDocument.getTextWidth(sourceRect.sourceCellInfo.text) > leftRect.w;\r\n var isTextLeftAlignment = !isDefined(sourceRect.sourceCellInfo.horizontalAlign) || \"left\" === sourceRect.sourceCellInfo.horizontalAlign;\r\n if (_isTextWidthGreaterThanRect || !isTextLeftAlignment) {\r\n var _sourceRect$sourceCel6, _sourceRect$sourceCel8, _sourceRect$sourceCel10;\r\n var leftTextLeftOffset;\r\n var rightTextLeftOffset;\r\n if (\"left\" === (null === (_sourceRect$sourceCel6 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel6 ? void 0 : _sourceRect$sourceCel6.horizontalAlign)) {\r\n var _sourceRect$sourceCel7;\r\n leftTextLeftOffset = null !== (_sourceRect$sourceCel7 = sourceRect.sourceCellInfo._textLeftOffset) && void 0 !== _sourceRect$sourceCel7 ? _sourceRect$sourceCel7 : 0;\r\n rightTextLeftOffset = leftTextLeftOffset - leftRect.w\r\n } else if (\"center\" === (null === (_sourceRect$sourceCel8 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel8 ? void 0 : _sourceRect$sourceCel8.horizontalAlign)) {\r\n var _sourceRect$sourceCel9;\r\n var offset = null !== (_sourceRect$sourceCel9 = sourceRect.sourceCellInfo._textLeftOffset) && void 0 !== _sourceRect$sourceCel9 ? _sourceRect$sourceCel9 : 0;\r\n leftTextLeftOffset = offset + (sourceRect.x + sourceRect.w / 2) - (leftRect.x + leftRect.w / 2);\r\n rightTextLeftOffset = offset + (sourceRect.x + sourceRect.w / 2) - (rightRect.x + rightRect.w / 2)\r\n } else if (\"right\" === (null === (_sourceRect$sourceCel10 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel10 ? void 0 : _sourceRect$sourceCel10.horizontalAlign)) {\r\n leftTextLeftOffset = sourceRect.x + sourceRect.w - (leftRect.x + leftRect.w);\r\n rightTextLeftOffset = sourceRect.x + sourceRect.w - (rightRect.x + rightRect.w)\r\n }\r\n leftRectTextOptions = _extends({}, {\r\n _textLeftOffset: leftTextLeftOffset\r\n });\r\n rightRectTextOptions = _extends({}, {\r\n _textLeftOffset: rightTextLeftOffset\r\n })\r\n } else {\r\n rightRectTextOptions = _extends({}, {\r\n text: \"\"\r\n })\r\n }\r\n }\r\n }\r\n leftRect.sourceCellInfo = _extends({}, sourceRect.sourceCellInfo, {\r\n debugSourceCellInfo: sourceRect.sourceCellInfo\r\n }, leftRectTextOptions);\r\n rightRect.sourceCellInfo = _extends({}, sourceRect.sourceCellInfo, {\r\n debugSourceCellInfo: sourceRect.sourceCellInfo\r\n }, rightRectTextOptions)\r\n }, _ref2 => {\r\n var _sourceRect$sourceCel11;\r\n var {\r\n sourceRect: sourceRect,\r\n topRect: topRect,\r\n bottomRect: bottomRect\r\n } = _ref2;\r\n var topRectTextOptions = {};\r\n var bottomRectTextOptions = {};\r\n var isTextNotEmpty = (null === (_sourceRect$sourceCel11 = sourceRect.sourceCellInfo.text) || void 0 === _sourceRect$sourceCel11 ? void 0 : _sourceRect$sourceCel11.length) > 0;\r\n if (isTextNotEmpty) {\r\n var _sourceRect$sourceCel12;\r\n var isTextHeightGreaterThanRect = jsPDFDocument.getTextDimensions(sourceRect.sourceCellInfo.text).h > topRect.h;\r\n var isTextTopAlignment = \"top\" === (null === (_sourceRect$sourceCel12 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel12 ? void 0 : _sourceRect$sourceCel12.verticalAlign);\r\n if (isTextHeightGreaterThanRect || !isTextTopAlignment) {\r\n var _sourceRect$sourceCel13, _sourceRect$sourceCel15, _sourceRect$sourceCel17;\r\n var topTextTopOffset;\r\n var bottomTextTopOffset;\r\n if (\"top\" === (null === (_sourceRect$sourceCel13 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel13 ? void 0 : _sourceRect$sourceCel13.verticalAlign)) {\r\n var _sourceRect$sourceCel14;\r\n topTextTopOffset = null !== (_sourceRect$sourceCel14 = sourceRect.sourceCellInfo._textTopOffset) && void 0 !== _sourceRect$sourceCel14 ? _sourceRect$sourceCel14 : 0;\r\n bottomTextTopOffset = topTextTopOffset - topRect.h\r\n } else if (\"middle\" === (null === (_sourceRect$sourceCel15 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel15 ? void 0 : _sourceRect$sourceCel15.verticalAlign)) {\r\n var _sourceRect$sourceCel16;\r\n var offset = null !== (_sourceRect$sourceCel16 = sourceRect.sourceCellInfo._textTopOffset) && void 0 !== _sourceRect$sourceCel16 ? _sourceRect$sourceCel16 : 0;\r\n topTextTopOffset = offset + (sourceRect.y + sourceRect.h / 2) - (topRect.y + topRect.h / 2);\r\n bottomTextTopOffset = offset + (sourceRect.y + sourceRect.h / 2) - (bottomRect.y + bottomRect.h / 2)\r\n } else if (\"bottom\" === (null === (_sourceRect$sourceCel17 = sourceRect.sourceCellInfo) || void 0 === _sourceRect$sourceCel17 ? void 0 : _sourceRect$sourceCel17.verticalAlign)) {\r\n topTextTopOffset = sourceRect.y + sourceRect.h - (topRect.y + topRect.h);\r\n bottomTextTopOffset = sourceRect.y + sourceRect.h - (bottomRect.y + bottomRect.h)\r\n }\r\n topRectTextOptions = _extends({}, {\r\n _textTopOffset: topTextTopOffset\r\n });\r\n bottomRectTextOptions = _extends({}, {\r\n _textTopOffset: bottomTextTopOffset\r\n })\r\n } else {\r\n bottomRectTextOptions = _extends({}, {\r\n text: \"\"\r\n })\r\n }\r\n }\r\n topRect.sourceCellInfo = _extends({}, sourceRect.sourceCellInfo, {\r\n debugSourceCellInfo: sourceRect.sourceCellInfo\r\n }, topRectTextOptions);\r\n bottomRect.sourceCellInfo = _extends({}, sourceRect.sourceCellInfo, {\r\n debugSourceCellInfo: sourceRect.sourceCellInfo\r\n }, bottomRectTextOptions)\r\n });\r\n if (rtlEnabled) {\r\n applyRtl(jsPDFDocument, rectsByPages, options)\r\n }\r\n rectsByPages.forEach((pdfCellsInfo, index) => {\r\n if (index > 0) {\r\n addNewPage(jsPDFDocument)\r\n }\r\n drawCellsContent(jsPDFDocument, options.customDrawCell, pdfCellsInfo, docStyles);\r\n drawCellsLines(jsPDFDocument, pdfCellsInfo, docStyles);\r\n var isEmptyPdfCellsInfoSpecified = isDefined(pdfCellsInfo) && 0 === pdfCellsInfo.length;\r\n if (isEmptyPdfCellsInfoSpecified) {\r\n var tableRect = calculateTableSize(jsPDFDocument, pdfCellsInfo, options);\r\n var baseStyle = getBaseTableStyle();\r\n drawGridLines(jsPDFDocument, tableRect, baseStyle, docStyles)\r\n }\r\n });\r\n setDocumentStyles(jsPDFDocument, docStyles);\r\n resolve()\r\n }).always(() => {\r\n if (initialLoadPanelEnabledOption) {\r\n component.option(\"loadPanel.enabled\", initialLoadPanelEnabledOption)\r\n }\r\n if (loadPanel.enabled && hasWindow()) {\r\n exportLoadPanel.dispose()\r\n }\r\n })\r\n })\r\n}\r\nexport var Export = {\r\n getFullOptions: _getFullOptions,\r\n export: exportDataGrid\r\n};\r\n","/**\r\n * DevExtreme (esm/exporter/jspdf/export_data_grid.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isDefined,\r\n isObject\r\n} from \"../../core/utils/type\";\r\nimport errors from \"../../core/errors\";\r\nimport {\r\n Export\r\n} from \"./common/export\";\r\nvar HOW_TO_MIGRATE_ARTICLE = \"https://supportcenter.devexpress.com/ticket/details/t1077554\";\r\n\r\nfunction _getFullOptions(options) {\r\n if (!(isDefined(options) && isObject(options))) {\r\n throw Error('The \"exportDataGrid\" method requires a configuration object.')\r\n }\r\n if (!(isDefined(options.component) && isObject(options.component) && \"dxDataGrid\" === options.component.NAME)) {\r\n throw Error('The \"component\" field must contain a DataGrid instance.')\r\n }\r\n if (!(isDefined(options.jsPDFDocument) && isObject(options.jsPDFDocument))) {\r\n throw Error('The \"jsPDFDocument\" field must contain a jsPDF instance.')\r\n }\r\n if (isDefined(options.autoTableOptions)) {\r\n errors.log(\"W0001\", \"Export\", \"autoTableOptions\", \"22.1\", \"You can migrate from exporting to PDF with the AutoTable plugin to a new export system. See the following topic for more information: \".concat(HOW_TO_MIGRATE_ARTICLE))\r\n }\r\n return Export.getFullOptions(options)\r\n}\r\n\r\nfunction exportDataGrid(options) {\r\n return Export.export(_getFullOptions(options))\r\n}\r\nexport {\r\n exportDataGrid\r\n};\r\n","/**\r\n * DevExtreme (esm/ui/toolbar/constants.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nexport var TOOLBAR_CLASS = \"dx-toolbar\";\r\n","/**\r\n * DevExtreme (esm/ui/shared/grouped_data_converter_mixin.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n isObject\r\n} from \"../../core/utils/type\";\r\nvar isCorrectStructure = data => Array.isArray(data) && data.every(item => {\r\n var hasTwoFields = 2 === Object.keys(item).length;\r\n var hasCorrectFields = \"key\" in item && \"items\" in item;\r\n return hasTwoFields && hasCorrectFields && Array.isArray(item.items)\r\n});\r\nexport default {\r\n _getSpecificDataSourceOption: function() {\r\n var dataSource = this.option(\"dataSource\");\r\n var hasSimpleItems = false;\r\n var data = {};\r\n if (this._getGroupedOption() && isCorrectStructure(dataSource)) {\r\n data = dataSource.reduce((accumulator, item) => {\r\n var items = item.items.map(innerItem => {\r\n if (!isObject(innerItem)) {\r\n innerItem = {\r\n text: innerItem\r\n };\r\n hasSimpleItems = true\r\n }\r\n if (!(\"key\" in innerItem)) {\r\n innerItem.key = item.key\r\n }\r\n return innerItem\r\n });\r\n return accumulator.concat(items)\r\n }, []);\r\n dataSource = {\r\n store: {\r\n type: \"array\",\r\n data: data\r\n },\r\n group: {\r\n selector: \"key\",\r\n keepInitialKeyOrder: true\r\n }\r\n };\r\n if (hasSimpleItems) {\r\n dataSource.searchExpr = \"text\"\r\n }\r\n }\r\n return dataSource\r\n }\r\n};\r\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Much of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// Many optimizations have been made, so the bundle size is ultimately smaller but performance is similar.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var u = ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([c], { type: 'text/javascript' })));\n var w = new Worker(u);\n w.onerror = function (e) { return cb(e.error, null); };\n w.onmessage = function (e) { return cb(null, e.data); };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i)\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) >> 0;\n return ((d[o] | (d[o + 1] << 8)) >>> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) >> 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >>> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p / 8) >> 0) + (p & 7 && 1); };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n st.f = final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n throw 'unexpected EOF';\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n if (!noSt && pos + tl * (clb + 7) > tbts)\n break;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n throw 'invalid block type';\n if (pos > tbts)\n throw 'unexpected EOF';\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var mxa = lbt + dbt + 18;\n while (noSt || pos + mxa < tbts) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts)\n throw 'unexpected EOF';\n if (!c)\n throw 'invalid length/literal';\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n throw 'invalid distance';\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts)\n throw 'unexpected EOF';\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = pos, st.b = bt;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) >> 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) >> 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [new u8(0), 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.floor(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768\n var imod = i & 32767;\n // previous index with this value\n var pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst)\n pos = wfblk(w, pos, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new u32(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && 0xEDB88320) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = 0xFFFFFFFF;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return c ^ 0xFFFFFFFF; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 5552, l);\n for (; i < e; ++i)\n n += d[i], m += n;\n n %= 65521, m %= 65521;\n }\n a = n, b = m;\n },\n d: function () { return ((a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8)) + ((a & 255) << 23) * 2; }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, hMap, max, bits, bits16, shft, slc, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n if (!opts.consume)\n dat = new u8(dat);\n w.postMessage([dat, opts], [dat.buffer]);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (t)\n throw 'stream finished';\n if (!strm.ondata)\n throw 'no stream handler';\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16)) + (d[b + 3] << 23) * 2; };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n throw 'invalid gzip data';\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) + (2 * (d[l - 1] << 23));\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n throw 'invalid zlib data';\n if (d[1] & 32)\n throw 'invalid zlib data: preset dictionaries not supported';\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (this.d)\n throw 'stream finished';\n if (!this.ondata)\n throw 'no stream handler';\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n if (opts === void 0) { opts = {}; }\n return dopt(data, opts, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (this.d)\n throw 'stream finished';\n if (!this.ondata)\n throw 'no stream handler';\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) >> 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (opts === void 0) { opts = {}; }\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = gzs(this.p);\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n throw 'invalid gzip stream';\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (opts === void 0) { opts = {}; }\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n throw 'invalid zlib stream';\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n throw 'no stream handler';\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n var l = str.length;\n if (!latin1 && typeof TextEncoder != 'undefined')\n return new TextEncoder().encode(str);\n var ar = new u8(str.length + (str.length >>> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >>> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >>> 18)), w(128 | ((c >>> 12) & 63)), w(128 | ((c >>> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >>> 12)), w(128 | ((c >>> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n var r = '';\n if (!latin1 && typeof TextDecoder != 'undefined')\n return new TextDecoder().decode(dat);\n for (var i = 0; i < dat.length;) {\n var c = dat[i++];\n if (c < 128 || latin1)\n r += String.fromCharCode(c);\n else if (c < 224)\n r += String.fromCharCode((c & 31) << 6 | (dat[i++] & 63));\n else if (c < 240)\n r += String.fromCharCode((c & 15) << 12 | (dat[i++] & 63) << 6 | (dat[i++] & 63));\n else\n c = ((c & 15) << 18 | (dat[i++] & 63) << 12 | (dat[i++] & 63) << 6 | (dat[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n return r;\n}\n;\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl;\n var _a = z ? z64e(d, es) : [b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b4(d, b + 12), b4(d, b + 4), b4(d, b + 20)];\n};\n// write zip header\nvar wzh = function (d, b, c, cmp, su, fn, u, o, ce, t) {\n var fl = fn.length, l = cmp.length;\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b] = 20, b += 2;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (t == 8 && (o.level == 1 ? 6 : o.level < 6 ? 4 : o.level == 9 ? 2 : 0)), d[b++] = u && 8;\n d[b] = t, b += 2;\n var dt = new Date(o.mtime || Date.now()), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n throw 'date not in range 1980-2099';\n wbytes(d, b, ((y << 24) * 2) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1));\n b += 4;\n wbytes(d, b, c);\n wbytes(d, b + 4, l);\n wbytes(d, b + 8, su);\n wbytes(d, b + 12, fl), b += 16; // skip extra field, comment\n if (ce != null)\n wbytes(d, b += 10, ce), b += 4;\n d.set(fn, b);\n b += fl;\n if (ce == null)\n d.set(cmp, b);\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n wzh(out, tot, f.c, f.d, f.m, f.n, f.u, f.p, null, f.t);\n wzh(out, o, f.c, f.d, f.m, f.n, f.u, f.p, tot, f.t), o += 46 + f.n.length, tot += 30 + f.n.length + f.d.length;\n }\n catch (e) {\n return cb(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cb(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), m = file.length;\n c.p(file);\n var n = strToU8(fn), s = n.length;\n var t = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cb(e, null);\n }\n else {\n var l = d.length;\n files[i] = {\n t: t,\n d: d,\n m: m,\n c: c.d(),\n u: fn.length != l,\n n: n,\n p: p\n };\n o += 30 + s + l;\n tot += 76 + 2 * s + l;\n if (!--lft)\n cbf();\n }\n };\n if (n.length > 65535)\n cbl('filename too long', null);\n if (!t)\n cbl(null, file);\n else if (m < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (opts === void 0) { opts = {}; }\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var t = p.level == 0 ? 0 : 8;\n var n = strToU8(fn), s = n.length;\n if (n.length > 65535)\n throw 'filename too long';\n var d = t ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push({\n t: t,\n d: d,\n m: file.length,\n c: c.d(),\n u: fn.length != s,\n n: n,\n o: o,\n p: p\n });\n o += 30 + s + l;\n tot += 76 + 2 * s + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f.c, f.d, f.m, f.n, f.u, f.p, null, f.t);\n wzh(out, o, f.c, f.d, f.m, f.n, f.u, f.p, f.o, f.t), o += 46 + f.n.length;\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Asynchronously decompresses a ZIP archive\n * @param data The raw compressed ZIP file\n * @param cb The callback to call with the decompressed files\n * @returns A function that can be used to immediately terminate the unzipping\n */\nexport function unzip(data, cb) {\n if (typeof cb != 'function')\n throw 'no callback';\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cb('invalid zip file', null);\n return;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (!lft)\n cb(null, {});\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n throw 'invalid zip file';\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var _loop_2 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cb(e, null);\n }\n else {\n files[fn] = d;\n if (!--lft)\n cb(null, files);\n }\n };\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl('unknown compression type ' + c_1, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_2(i);\n }\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @returns The decompressed files\n */\nexport function unzipSync(data) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n throw 'invalid zip file';\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n throw 'invalid zip file';\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n throw 'unknown compression type ' + c_2;\n }\n return files;\n}\n","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DrivingRangeAdditionSurcharge.vue?vue&type=style&index=0&id=3dc83084&prod&lang=scss\"","/**\r\n * DevExtreme (esm/ui/list/ui.list.edit.decorator.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n getWidth\r\n} from \"../../core/utils/size\";\r\nimport $ from \"../../core/renderer\";\r\nimport eventsEngine from \"../../events/core/events_engine\";\r\nimport {\r\n noop\r\n} from \"../../core/utils/common\";\r\nimport Class from \"../../core/class\";\r\nimport {\r\n start as swipeEventStart,\r\n swipe as swipeEventSwipe,\r\n end as swipeEventEnd\r\n} from \"../../events/swipe\";\r\nimport {\r\n addNamespace\r\n} from \"../../events/utils/index\";\r\nvar LIST_EDIT_DECORATOR = \"dxListEditDecorator\";\r\nvar SWIPE_START_EVENT_NAME = addNamespace(swipeEventStart, LIST_EDIT_DECORATOR);\r\nvar SWIPE_UPDATE_EVENT_NAME = addNamespace(swipeEventSwipe, LIST_EDIT_DECORATOR);\r\nvar SWIPE_END_EVENT_NAME = addNamespace(swipeEventEnd, LIST_EDIT_DECORATOR);\r\nvar EditDecorator = Class.inherit({\r\n ctor: function(list) {\r\n this._list = list;\r\n this._init()\r\n },\r\n _init: noop,\r\n _shouldHandleSwipe: false,\r\n _attachSwipeEvent: function(config) {\r\n var swipeConfig = {\r\n itemSizeFunc: function() {\r\n if (this._clearSwipeCache) {\r\n this._itemWidthCache = getWidth(this._list.$element());\r\n this._clearSwipeCache = false\r\n }\r\n return this._itemWidthCache\r\n }.bind(this)\r\n };\r\n eventsEngine.on(config.$itemElement, SWIPE_START_EVENT_NAME, swipeConfig, this._itemSwipeStartHandler.bind(this));\r\n eventsEngine.on(config.$itemElement, SWIPE_UPDATE_EVENT_NAME, this._itemSwipeUpdateHandler.bind(this));\r\n eventsEngine.on(config.$itemElement, SWIPE_END_EVENT_NAME, this._itemSwipeEndHandler.bind(this))\r\n },\r\n _itemSwipeStartHandler: function(e) {\r\n var $itemElement = $(e.currentTarget);\r\n if ($itemElement.is(\".dx-state-disabled, .dx-state-disabled *\")) {\r\n e.cancel = true;\r\n return\r\n }\r\n clearTimeout(this._list._inkRippleTimer);\r\n this._swipeStartHandler($itemElement, e)\r\n },\r\n _itemSwipeUpdateHandler: function(e) {\r\n var $itemElement = $(e.currentTarget);\r\n this._swipeUpdateHandler($itemElement, e)\r\n },\r\n _itemSwipeEndHandler: function(e) {\r\n var $itemElement = $(e.currentTarget);\r\n this._swipeEndHandler($itemElement, e);\r\n this._clearSwipeCache = true\r\n },\r\n beforeBag: noop,\r\n afterBag: noop,\r\n _commonOptions: function() {\r\n return {\r\n activeStateEnabled: this._list.option(\"activeStateEnabled\"),\r\n hoverStateEnabled: this._list.option(\"hoverStateEnabled\"),\r\n focusStateEnabled: this._list.option(\"focusStateEnabled\")\r\n }\r\n },\r\n modifyElement: function(config) {\r\n if (this._shouldHandleSwipe) {\r\n this._attachSwipeEvent(config);\r\n this._clearSwipeCache = true\r\n }\r\n },\r\n afterRender: noop,\r\n handleClick: noop,\r\n handleKeyboardEvents: noop,\r\n handleEnterPressing: noop,\r\n handleContextMenu: noop,\r\n _swipeStartHandler: noop,\r\n _swipeUpdateHandler: noop,\r\n _swipeEndHandler: noop,\r\n visibilityChange: noop,\r\n getExcludedSelectors: noop,\r\n dispose: noop\r\n});\r\nexport default EditDecorator;\r\n","/**\r\n * DevExtreme (esm/ui/grid_core/ui.grid_core.utils.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\r\nimport {\r\n getHeight\r\n} from \"../../core/utils/size\";\r\nimport $ from \"../../core/renderer\";\r\nimport {\r\n isDefined,\r\n isFunction,\r\n isString\r\n} from \"../../core/utils/type\";\r\nimport {\r\n when,\r\n Deferred\r\n} from \"../../core/utils/deferred\";\r\nimport sharedFiltering from \"../shared/filtering\";\r\nimport {\r\n format\r\n} from \"../../core/utils/string\";\r\nimport {\r\n each\r\n} from \"../../core/utils/iterator\";\r\nimport {\r\n extend\r\n} from \"../../core/utils/extend\";\r\nimport {\r\n getBoundingRect\r\n} from \"../../core/utils/position\";\r\nimport {\r\n toComparable\r\n} from \"../../core/utils/data\";\r\nimport {\r\n equalByValue\r\n} from \"../../core/utils/common\";\r\nimport LoadPanel from \"../load_panel\";\r\nimport {\r\n normalizeSortingInfo as normalizeSortingInfoUtility\r\n} from \"../../data/utils\";\r\nimport formatHelper from \"../../format_helper\";\r\nimport {\r\n getWindow\r\n} from \"../../core/utils/window\";\r\nimport eventsEngine from \"../../events/core/events_engine\";\r\nimport {\r\n DataSource\r\n} from \"../../data/data_source/data_source\";\r\nimport ArrayStore from \"../../data/array_store\";\r\nimport {\r\n normalizeDataSourceOptions\r\n} from \"../../data/data_source/utils\";\r\nimport variableWrapper from \"../../core/utils/variable_wrapper\";\r\nvar DATAGRID_SELECTION_DISABLED_CLASS = \"dx-selection-disabled\";\r\nvar DATAGRID_GROUP_OPENED_CLASS = \"dx-datagrid-group-opened\";\r\nvar DATAGRID_GROUP_CLOSED_CLASS = \"dx-datagrid-group-closed\";\r\nvar DATAGRID_EXPAND_CLASS = \"dx-datagrid-expand\";\r\nvar NO_DATA_CLASS = \"nodata\";\r\nvar SCROLLING_MODE_INFINITE = \"infinite\";\r\nvar SCROLLING_MODE_VIRTUAL = \"virtual\";\r\nvar LEGACY_SCROLLING_MODE = \"scrolling.legacyMode\";\r\nvar SCROLLING_MODE_OPTION = \"scrolling.mode\";\r\nvar ROW_RENDERING_MODE_OPTION = \"scrolling.rowRenderingMode\";\r\nvar DATE_INTERVAL_SELECTORS = {\r\n year: function(value) {\r\n return value && value.getFullYear()\r\n },\r\n month: function(value) {\r\n return value && value.getMonth() + 1\r\n },\r\n day: function(value) {\r\n return value && value.getDate()\r\n },\r\n quarter: function(value) {\r\n return value && Math.floor(value.getMonth() / 3) + 1\r\n },\r\n hour: function(value) {\r\n return value && value.getHours()\r\n },\r\n minute: function(value) {\r\n return value && value.getMinutes()\r\n },\r\n second: function(value) {\r\n return value && value.getSeconds()\r\n }\r\n};\r\nvar getIntervalSelector = function() {\r\n var data = arguments[1];\r\n var value = this.calculateCellValue(data);\r\n if (!isDefined(value)) {\r\n return null\r\n } else if (isDateType(this.dataType)) {\r\n var nameIntervalSelector = arguments[0];\r\n return DATE_INTERVAL_SELECTORS[nameIntervalSelector](value)\r\n } else if (\"number\" === this.dataType) {\r\n var groupInterval = arguments[0];\r\n return Math.floor(Number(value) / groupInterval) * groupInterval\r\n }\r\n};\r\nvar equalSelectors = function(selector1, selector2) {\r\n if (isFunction(selector1) && isFunction(selector2)) {\r\n if (selector1.originalCallback && selector2.originalCallback) {\r\n return selector1.originalCallback === selector2.originalCallback && selector1.columnIndex === selector2.columnIndex\r\n }\r\n }\r\n return selector1 === selector2\r\n};\r\n\r\nfunction isDateType(dataType) {\r\n return \"date\" === dataType || \"datetime\" === dataType\r\n}\r\nvar setEmptyText = function($container) {\r\n $container.get(0).textContent = \"\\xa0\"\r\n};\r\nvar normalizeSortingInfo = function(sort) {\r\n sort = sort || [];\r\n var result = normalizeSortingInfoUtility(sort);\r\n for (var i = 0; i < sort.length; i++) {\r\n if (sort && sort[i] && void 0 !== sort[i].isExpanded) {\r\n result[i].isExpanded = sort[i].isExpanded\r\n }\r\n if (sort && sort[i] && void 0 !== sort[i].groupInterval) {\r\n result[i].groupInterval = sort[i].groupInterval\r\n }\r\n }\r\n return result\r\n};\r\nvar formatValue = function(value, options) {\r\n var valueText = formatHelper.format(value, options.format) || value && value.toString() || \"\";\r\n var formatObject = {\r\n value: value,\r\n valueText: options.getDisplayFormat ? options.getDisplayFormat(valueText) : valueText,\r\n target: options.target || \"row\",\r\n groupInterval: options.groupInterval\r\n };\r\n return options.customizeText ? options.customizeText.call(options, formatObject) : formatObject.valueText\r\n};\r\nvar getSummaryText = function(summaryItem, summaryTexts) {\r\n var displayFormat = summaryItem.displayFormat || summaryItem.columnCaption && summaryTexts[summaryItem.summaryType + \"OtherColumn\"] || summaryTexts[summaryItem.summaryType];\r\n return formatValue(summaryItem.value, {\r\n format: summaryItem.valueFormat,\r\n getDisplayFormat: function(valueText) {\r\n return displayFormat ? format(displayFormat, valueText, summaryItem.columnCaption) : valueText\r\n },\r\n customizeText: summaryItem.customizeText\r\n })\r\n};\r\nvar getWidgetInstance = function($element) {\r\n var editorData = $element.data && $element.data();\r\n var dxComponents = editorData && editorData.dxComponents;\r\n var widgetName = dxComponents && dxComponents[0];\r\n return widgetName && editorData[widgetName]\r\n};\r\nvar equalFilterParameters = function equalFilterParameters(filter1, filter2) {\r\n if (Array.isArray(filter1) && Array.isArray(filter2)) {\r\n if (filter1.length !== filter2.length) {\r\n return false\r\n } else {\r\n for (var i = 0; i < filter1.length; i++) {\r\n if (!equalFilterParameters(filter1[i], filter2[i])) {\r\n return false\r\n }\r\n }\r\n }\r\n return true\r\n } else if (isFunction(filter1) && filter1.columnIndex >= 0 && isFunction(filter2) && filter2.columnIndex >= 0) {\r\n return filter1.columnIndex === filter2.columnIndex && toComparable(filter1.filterValue) === toComparable(filter2.filterValue)\r\n } else {\r\n return toComparable(filter1) == toComparable(filter2)\r\n }\r\n};\r\n\r\nfunction normalizeGroupingLoadOptions(group) {\r\n if (!Array.isArray(group)) {\r\n group = [group]\r\n }\r\n return group.map((item, i) => {\r\n if (isString(item)) {\r\n return {\r\n selector: item,\r\n isExpanded: i < group.length - 1\r\n }\r\n }\r\n return item\r\n })\r\n}\r\nexport default {\r\n renderNoDataText: function($element) {\r\n $element = $element || this.element();\r\n if (!$element) {\r\n return\r\n }\r\n var noDataClass = this.addWidgetPrefix(NO_DATA_CLASS);\r\n var noDataElement = $element.find(\".\" + noDataClass).last();\r\n var isVisible = this._dataController.isEmpty();\r\n var isLoading = this._dataController.isLoading();\r\n if (!noDataElement.length) {\r\n noDataElement = $(\"
\").addClass(noDataClass).appendTo($element)\r\n }\r\n if (isVisible && !isLoading) {\r\n noDataElement.removeClass(\"dx-hidden\").text(this._getNoDataText())\r\n } else {\r\n noDataElement.addClass(\"dx-hidden\")\r\n }\r\n },\r\n renderLoadPanel: function($element, $container, isLocalStore) {\r\n var loadPanelOptions;\r\n this._loadPanel && this._loadPanel.$element().remove();\r\n loadPanelOptions = this.option(\"loadPanel\");\r\n if (loadPanelOptions && (\"auto\" === loadPanelOptions.enabled ? !isLocalStore : loadPanelOptions.enabled)) {\r\n loadPanelOptions = extend({\r\n shading: false,\r\n message: loadPanelOptions.text,\r\n container: $container\r\n }, loadPanelOptions);\r\n this._loadPanel = this._createComponent($(\"\").appendTo($container), LoadPanel, loadPanelOptions)\r\n } else {\r\n this._loadPanel = null\r\n }\r\n },\r\n calculateLoadPanelPosition($element) {\r\n var $window = $(getWindow());\r\n if (getHeight($element) > getHeight($window)) {\r\n return {\r\n of: $window,\r\n boundary: $element,\r\n collision: \"fit\"\r\n }\r\n }\r\n return {\r\n of: $element\r\n }\r\n },\r\n getIndexByKey: function(key, items, keyName) {\r\n var index = -1;\r\n if (void 0 !== key && Array.isArray(items)) {\r\n keyName = arguments.length <= 2 ? \"key\" : keyName;\r\n for (var i = 0; i < items.length; i++) {\r\n var item = isDefined(keyName) ? items[i][keyName] : items[i];\r\n if (equalByValue(key, item)) {\r\n index = i;\r\n break\r\n }\r\n }\r\n }\r\n return index\r\n },\r\n combineFilters: function(filters, operation) {\r\n var resultFilter = [];\r\n operation = operation || \"and\";\r\n for (var i = 0; i < filters.length; i++) {\r\n var _filters$i;\r\n if (!filters[i]) {\r\n continue\r\n }\r\n if (1 === (null === (_filters$i = filters[i]) || void 0 === _filters$i ? void 0 : _filters$i.length) && \"!\" === filters[i][0]) {\r\n if (\"and\" === operation) {\r\n return [\"!\"]\r\n } else if (\"or\" === operation) {\r\n continue\r\n }\r\n }\r\n if (resultFilter.length) {\r\n resultFilter.push(operation)\r\n }\r\n resultFilter.push(filters[i])\r\n }\r\n if (1 === resultFilter.length) {\r\n resultFilter = resultFilter[0]\r\n }\r\n if (resultFilter.length) {\r\n return resultFilter\r\n }\r\n },\r\n checkChanges: function(changes, changeNames) {\r\n var changesWithChangeNamesCount = 0;\r\n for (var i = 0; i < changeNames.length; i++) {\r\n if (changes[changeNames[i]]) {\r\n changesWithChangeNamesCount++\r\n }\r\n }\r\n return changes.length && changes.length === changesWithChangeNamesCount\r\n },\r\n equalFilterParameters: equalFilterParameters,\r\n proxyMethod: function(instance, methodName, defaultResult) {\r\n if (!instance[methodName]) {\r\n instance[methodName] = function() {\r\n var dataSource = this._dataSource;\r\n return dataSource ? dataSource[methodName].apply(dataSource, arguments) : defaultResult\r\n }\r\n }\r\n },\r\n formatValue: formatValue,\r\n getFormatOptionsByColumn: function(column, target) {\r\n return {\r\n format: column.format,\r\n getDisplayFormat: column.getDisplayFormat,\r\n customizeText: column.customizeText,\r\n target: target,\r\n trueText: column.trueText,\r\n falseText: column.falseText\r\n }\r\n },\r\n getDisplayValue: function(column, value, data, rowType) {\r\n if (column.displayValueMap && void 0 !== column.displayValueMap[value]) {\r\n return column.displayValueMap[value]\r\n } else if (column.calculateDisplayValue && data && \"group\" !== rowType) {\r\n return column.calculateDisplayValue(data)\r\n } else if (column.lookup && !(\"group\" === rowType && (column.calculateGroupValue || column.calculateDisplayValue))) {\r\n return column.lookup.calculateCellValue(value)\r\n }\r\n return value\r\n },\r\n getGroupRowSummaryText: function(summaryItems, summaryTexts) {\r\n var result = \"(\";\r\n for (var i = 0; i < summaryItems.length; i++) {\r\n var summaryItem = summaryItems[i];\r\n result += (i > 0 ? \", \" : \"\") + getSummaryText(summaryItem, summaryTexts)\r\n }\r\n return result + \")\"\r\n },\r\n getSummaryText: getSummaryText,\r\n normalizeSortingInfo: normalizeSortingInfo,\r\n getFormatByDataType: function(dataType) {\r\n switch (dataType) {\r\n case \"date\":\r\n return \"shortDate\";\r\n case \"datetime\":\r\n return \"shortDateShortTime\"\r\n }\r\n },\r\n getHeaderFilterGroupParameters: function(column, remoteGrouping) {\r\n var result = [];\r\n var dataField = column.dataField || column.name;\r\n var groupInterval = sharedFiltering.getGroupInterval(column);\r\n if (groupInterval) {\r\n each(groupInterval, (function(index, interval) {\r\n result.push(remoteGrouping ? {\r\n selector: dataField,\r\n groupInterval: interval,\r\n isExpanded: index < groupInterval.length - 1\r\n } : getIntervalSelector.bind(column, interval))\r\n }));\r\n return result\r\n }\r\n if (remoteGrouping) {\r\n result = [{\r\n selector: dataField,\r\n isExpanded: false\r\n }]\r\n } else {\r\n result = function(data) {\r\n var result = column.calculateCellValue(data);\r\n if (void 0 === result || \"\" === result) {\r\n result = null\r\n }\r\n return result\r\n };\r\n if (column.sortingMethod) {\r\n result = [{\r\n selector: result,\r\n compare: column.sortingMethod.bind(column)\r\n }]\r\n }\r\n }\r\n return result\r\n },\r\n equalSortParameters(sortParameters1, sortParameters2, ignoreIsExpanded) {\r\n sortParameters1 = normalizeSortingInfo(sortParameters1);\r\n sortParameters2 = normalizeSortingInfo(sortParameters2);\r\n if (Array.isArray(sortParameters1) && Array.isArray(sortParameters2)) {\r\n if (sortParameters1.length !== sortParameters2.length) {\r\n return false\r\n } else {\r\n for (var i = 0; i < sortParameters1.length; i++) {\r\n if (!equalSelectors(sortParameters1[i].selector, sortParameters2[i].selector) || sortParameters1[i].desc !== sortParameters2[i].desc || sortParameters1[i].groupInterval !== sortParameters2[i].groupInterval || !ignoreIsExpanded && Boolean(sortParameters1[i].isExpanded) !== Boolean(sortParameters2[i].isExpanded)) {\r\n return false\r\n }\r\n }\r\n }\r\n return true\r\n } else {\r\n return (!sortParameters1 || !sortParameters1.length) === (!sortParameters2 || !sortParameters2.length)\r\n }\r\n },\r\n getPointsByColumns: function(items, pointCreated, isVertical, startColumnIndex) {\r\n var cellsLength = items.length;\r\n var notCreatePoint = false;\r\n var item;\r\n var offset;\r\n var columnIndex = startColumnIndex || 0;\r\n var result = [];\r\n var rtlEnabled;\r\n for (var i = 0; i <= cellsLength; i++) {\r\n if (i < cellsLength) {\r\n item = items.eq(i);\r\n offset = item.offset();\r\n rtlEnabled = \"rtl\" === item.css(\"direction\")\r\n }\r\n var point = {\r\n index: columnIndex,\r\n x: offset ? offset.left + (!isVertical && rtlEnabled ^ i === cellsLength ? getBoundingRect(item[0]).width : 0) : 0,\r\n y: offset ? offset.top + (isVertical && i === cellsLength ? getBoundingRect(item[0]).height : 0) : 0,\r\n columnIndex: columnIndex\r\n };\r\n if (!isVertical && i > 0) {\r\n var prevItemOffset = items.eq(i - 1).offset();\r\n if (prevItemOffset.top < point.y) {\r\n point.y = prevItemOffset.top\r\n }\r\n }\r\n if (pointCreated) {\r\n notCreatePoint = pointCreated(point)\r\n }\r\n if (!notCreatePoint) {\r\n result.push(point)\r\n }\r\n columnIndex++\r\n }\r\n return result\r\n },\r\n getExpandCellTemplate: function() {\r\n return {\r\n allowRenderToDetachedContainer: true,\r\n render: function(container, options) {\r\n var $container = $(container);\r\n if (isDefined(options.value) && !(options.data && options.data.isContinuation) && !options.row.isNewRow) {\r\n var rowsView = options.component.getView(\"rowsView\");\r\n $container.addClass(DATAGRID_EXPAND_CLASS).addClass(DATAGRID_SELECTION_DISABLED_CLASS);\r\n $(\"
\").addClass(options.value ? DATAGRID_GROUP_OPENED_CLASS : DATAGRID_GROUP_CLOSED_CLASS).appendTo($container);\r\n rowsView.setAria(\"label\", options.value ? rowsView.localize(\"dxDataGrid-ariaCollapse\") : rowsView.localize(\"dxDataGrid-ariaExpand\"), $container)\r\n } else {\r\n setEmptyText($container)\r\n }\r\n }\r\n }\r\n },\r\n setEmptyText: setEmptyText,\r\n isDateType: isDateType,\r\n getSelectionRange: function(focusedElement) {\r\n try {\r\n if (focusedElement) {\r\n return {\r\n selectionStart: focusedElement.selectionStart,\r\n selectionEnd: focusedElement.selectionEnd\r\n }\r\n }\r\n } catch (e) {}\r\n return {}\r\n },\r\n setSelectionRange: function(focusedElement, selectionRange) {\r\n try {\r\n if (focusedElement && focusedElement.setSelectionRange) {\r\n focusedElement.setSelectionRange(selectionRange.selectionStart, selectionRange.selectionEnd)\r\n }\r\n } catch (e) {}\r\n },\r\n focusAndSelectElement: function(component, $element) {\r\n var isFocused = $element.is(\":focus\");\r\n eventsEngine.trigger($element, \"focus\");\r\n var isSelectTextOnEditingStart = component.option(\"editing.selectTextOnEditStart\");\r\n var element = $element.get(0);\r\n if (!isFocused && isSelectTextOnEditingStart && $element.is(\".dx-texteditor-input\") && !$element.is(\"[readonly]\")) {\r\n var editor = getWidgetInstance($element.closest(\".dx-texteditor\"));\r\n when(editor && editor._loadItemDeferred).done((function() {\r\n element.select()\r\n }))\r\n }\r\n },\r\n getWidgetInstance: getWidgetInstance,\r\n getLastResizableColumnIndex: function(columns, resultWidths) {\r\n var hasResizableColumns = columns.some(column => column && !column.command && !column.fixed && false !== column.allowResizing);\r\n var lastColumnIndex;\r\n for (lastColumnIndex = columns.length - 1; columns[lastColumnIndex]; lastColumnIndex--) {\r\n var column = columns[lastColumnIndex];\r\n var width = resultWidths && resultWidths[lastColumnIndex];\r\n var allowResizing = !hasResizableColumns || false !== column.allowResizing;\r\n if (!column.command && !column.fixed && \"adaptiveHidden\" !== width && allowResizing) {\r\n break\r\n }\r\n }\r\n return lastColumnIndex\r\n },\r\n isElementInCurrentGrid: function(controller, $element) {\r\n if ($element && $element.length) {\r\n var $grid = $element.closest(\".\" + controller.getWidgetContainerClass()).parent();\r\n return $grid.is(controller.component.$element())\r\n }\r\n return false\r\n },\r\n isVirtualRowRendering: function(that) {\r\n var rowRenderingMode = that.option(ROW_RENDERING_MODE_OPTION);\r\n var isVirtualMode = that.option(SCROLLING_MODE_OPTION) === SCROLLING_MODE_VIRTUAL;\r\n var isAppendMode = that.option(SCROLLING_MODE_OPTION) === SCROLLING_MODE_INFINITE;\r\n if (false === that.option(LEGACY_SCROLLING_MODE) && (isVirtualMode || isAppendMode)) {\r\n return true\r\n }\r\n return rowRenderingMode === SCROLLING_MODE_VIRTUAL\r\n },\r\n getPixelRatio: function(window) {\r\n return window.devicePixelRatio || 1\r\n },\r\n getContentHeightLimit(browser) {\r\n if (browser.mozilla) {\r\n return 8e6\r\n }\r\n return 15e6 / this.getPixelRatio(getWindow())\r\n },\r\n normalizeLookupDataSource(lookup) {\r\n var lookupDataSourceOptions;\r\n if (lookup.items) {\r\n lookupDataSourceOptions = lookup.items\r\n } else {\r\n lookupDataSourceOptions = lookup.dataSource;\r\n if (isFunction(lookupDataSourceOptions) && !variableWrapper.isWrapped(lookupDataSourceOptions)) {\r\n lookupDataSourceOptions = lookupDataSourceOptions({})\r\n }\r\n }\r\n return normalizeDataSourceOptions(lookupDataSourceOptions)\r\n },\r\n getWrappedLookupDataSource(column, dataSource, filter) {\r\n var lookupDataSourceOptions = this.normalizeLookupDataSource(column.lookup);\r\n if (column.calculateCellValue !== column.defaultCalculateCellValue) {\r\n return lookupDataSourceOptions\r\n }\r\n var hasGroupPaging = dataSource.remoteOperations().groupPaging;\r\n var hasLookupOptimization = column.displayField && isString(column.displayField);\r\n var cachedUniqueRelevantItems;\r\n var lookupDataSource = _extends({}, lookupDataSourceOptions, {\r\n load: loadOptions => {\r\n var d = new Deferred;\r\n (loadOptions => {\r\n var group = normalizeGroupingLoadOptions(hasLookupOptimization ? [column.dataField, column.displayField] : column.dataField);\r\n var d = new Deferred;\r\n if (!hasGroupPaging && cachedUniqueRelevantItems) {\r\n d.resolve(cachedUniqueRelevantItems)\r\n } else {\r\n dataSource.load({\r\n filter: filter,\r\n group: group,\r\n take: hasGroupPaging ? loadOptions.take : void 0,\r\n skip: hasGroupPaging ? loadOptions.skip : void 0\r\n }).done(items => {\r\n cachedUniqueRelevantItems = items;\r\n d.resolve(items)\r\n }).fail(d.fail)\r\n }\r\n return d\r\n })(loadOptions).done(items => {\r\n if (0 === items.length) {\r\n d.resolve([])\r\n }\r\n var newDataSource;\r\n if (hasLookupOptimization) {\r\n var lookupItems = items.map(item => {\r\n var _column$displayValueM;\r\n return {\r\n [column.lookup.valueExpr]: item.key,\r\n [column.lookup.displayExpr]: null !== (_column$displayValueM = column.displayValueMap[item.key]) && void 0 !== _column$displayValueM ? _column$displayValueM : item.items[0].key\r\n }\r\n });\r\n newDataSource = new DataSource(_extends({}, lookupDataSourceOptions, loadOptions, {\r\n store: new ArrayStore({\r\n data: lookupItems,\r\n key: column.lookup.valueExpr\r\n })\r\n }))\r\n } else {\r\n var _filter = this.combineFilters(items.flatMap(data => data.key).map(key => [column.lookup.valueExpr, key]), \"or\");\r\n newDataSource = new DataSource(_extends({}, lookupDataSourceOptions, loadOptions, {\r\n filter: this.combineFilters([_filter, loadOptions.filter], \"and\")\r\n }))\r\n }\r\n if (!hasGroupPaging) {\r\n newDataSource.on(\"customizeStoreLoadOptions\", e => {\r\n e.storeLoadOptions.take = loadOptions.take;\r\n e.storeLoadOptions.skip = loadOptions.skip\r\n })\r\n }\r\n newDataSource.load().done(d.resolve).fail(d.fail)\r\n }).fail(d.fail);\r\n return d\r\n },\r\n key: column.lookup.valueExpr,\r\n byKey(key) {\r\n var d = Deferred();\r\n this.load({\r\n filter: [column.lookup.valueExpr, \"=\", key]\r\n }).done(arr => {\r\n d.resolve(arr[0])\r\n });\r\n return d.promise()\r\n }\r\n });\r\n return lookupDataSource\r\n }\r\n};\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-modal',{attrs:{\"id\":\"modal-danger\",\"ok-variant\":\"danger\",\"cancel-variant\":\"outline-secondary\",\"cancel-title\":_vm.$t('golf_common_back'),\"ok-title\":_vm.$t('golf_common_confirm'),\"modal-class\":\"modal-danger\",\"centered\":\"\",\"size\":\"xs\",\"title\":_vm.ob.title},on:{\"ok\":_vm.deleteItem,\"hidden\":_vm.resetModal},model:{value:(_vm.deleteDialog),callback:function ($$v) {_vm.deleteDialog=$$v},expression:\"deleteDialog\"}},[_c('b-card-text',[_c('div',{staticStyle:{\"padding\":\"20px 16px\"}},[_vm._v(\" \"+_vm._s(_vm.ob.content))])])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n
\r\n \r\n \r\n {{ob.content}}
\r\n \r\n \r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DeleteDialog.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DeleteDialog.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./DeleteDialog.vue?vue&type=template&id=41a74220\"\nimport script from \"./DeleteDialog.vue?vue&type=script&lang=js\"\nexport * from \"./DeleteDialog.vue?vue&type=script&lang=js\"\nimport style0 from \"./DeleteDialog.vue?vue&type=style&index=0&id=41a74220&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PackageDrivingRangeDistribution.vue?vue&type=style&index=0&id=2fb7c24d&prod&lang=scss\"","var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nvar NumeralFormatter = function (numeralDecimalMark,\n numeralIntegerScale,\n numeralDecimalScale,\n numeralThousandsGroupStyle,\n numeralPositiveOnly,\n stripLeadingZeroes,\n prefix,\n signBeforePrefix,\n tailPrefix,\n delimiter) {\n var owner = this;\n\n owner.numeralDecimalMark = numeralDecimalMark || '.';\n owner.numeralIntegerScale = numeralIntegerScale > 0 ? numeralIntegerScale : 0;\n owner.numeralDecimalScale = numeralDecimalScale >= 0 ? numeralDecimalScale : 2;\n owner.numeralThousandsGroupStyle = numeralThousandsGroupStyle || NumeralFormatter.groupStyle.thousand;\n owner.numeralPositiveOnly = !!numeralPositiveOnly;\n owner.stripLeadingZeroes = stripLeadingZeroes !== false;\n owner.prefix = (prefix || prefix === '') ? prefix : '';\n owner.signBeforePrefix = !!signBeforePrefix;\n owner.tailPrefix = !!tailPrefix;\n owner.delimiter = (delimiter || delimiter === '') ? delimiter : ',';\n owner.delimiterRE = delimiter ? new RegExp('\\\\' + delimiter, 'g') : '';\n};\n\nNumeralFormatter.groupStyle = {\n thousand: 'thousand',\n lakh: 'lakh',\n wan: 'wan',\n none: 'none' \n};\n\nNumeralFormatter.prototype = {\n getRawValue: function (value) {\n return value.replace(this.delimiterRE, '').replace(this.numeralDecimalMark, '.');\n },\n\n format: function (value) {\n var owner = this, parts, partSign, partSignAndPrefix, partInteger, partDecimal = '';\n\n // strip alphabet letters\n value = value.replace(/[A-Za-z]/g, '')\n // replace the first decimal mark with reserved placeholder\n .replace(owner.numeralDecimalMark, 'M')\n\n // strip non numeric letters except minus and \"M\"\n // this is to ensure prefix has been stripped\n .replace(/[^\\dM-]/g, '')\n\n // replace the leading minus with reserved placeholder\n .replace(/^\\-/, 'N')\n\n // strip the other minus sign (if present)\n .replace(/\\-/g, '')\n\n // replace the minus sign (if present)\n .replace('N', owner.numeralPositiveOnly ? '' : '-')\n\n // replace decimal mark\n .replace('M', owner.numeralDecimalMark);\n\n // strip any leading zeros\n if (owner.stripLeadingZeroes) {\n value = value.replace(/^(-)?0+(?=\\d)/, '$1');\n }\n\n partSign = value.slice(0, 1) === '-' ? '-' : '';\n if (typeof owner.prefix != 'undefined') {\n if (owner.signBeforePrefix) {\n partSignAndPrefix = partSign + owner.prefix;\n } else {\n partSignAndPrefix = owner.prefix + partSign;\n }\n } else {\n partSignAndPrefix = partSign;\n }\n \n partInteger = value;\n\n if (value.indexOf(owner.numeralDecimalMark) >= 0) {\n parts = value.split(owner.numeralDecimalMark);\n partInteger = parts[0];\n partDecimal = owner.numeralDecimalMark + parts[1].slice(0, owner.numeralDecimalScale);\n }\n\n if(partSign === '-') {\n partInteger = partInteger.slice(1);\n }\n\n if (owner.numeralIntegerScale > 0) {\n partInteger = partInteger.slice(0, owner.numeralIntegerScale);\n }\n\n switch (owner.numeralThousandsGroupStyle) {\n case NumeralFormatter.groupStyle.lakh:\n partInteger = partInteger.replace(/(\\d)(?=(\\d\\d)+\\d$)/g, '$1' + owner.delimiter);\n\n break;\n\n case NumeralFormatter.groupStyle.wan:\n partInteger = partInteger.replace(/(\\d)(?=(\\d{4})+$)/g, '$1' + owner.delimiter);\n\n break;\n\n case NumeralFormatter.groupStyle.thousand:\n partInteger = partInteger.replace(/(\\d)(?=(\\d{3})+$)/g, '$1' + owner.delimiter);\n\n break;\n }\n\n if (owner.tailPrefix) {\n return partSign + partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : '') + owner.prefix;\n }\n\n return partSignAndPrefix + partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : '');\n }\n};\n\nvar NumeralFormatter_1 = NumeralFormatter;\n\nvar DateFormatter = function (datePattern, dateMin, dateMax) {\n var owner = this;\n\n owner.date = [];\n owner.blocks = [];\n owner.datePattern = datePattern;\n owner.dateMin = dateMin\n .split('-')\n .reverse()\n .map(function(x) {\n return parseInt(x, 10);\n });\n if (owner.dateMin.length === 2) owner.dateMin.unshift(0);\n\n owner.dateMax = dateMax\n .split('-')\n .reverse()\n .map(function(x) {\n return parseInt(x, 10);\n });\n if (owner.dateMax.length === 2) owner.dateMax.unshift(0);\n \n owner.initBlocks();\n};\n\nDateFormatter.prototype = {\n initBlocks: function () {\n var owner = this;\n owner.datePattern.forEach(function (value) {\n if (value === 'Y') {\n owner.blocks.push(4);\n } else {\n owner.blocks.push(2);\n }\n });\n },\n\n getISOFormatDate: function () {\n var owner = this,\n date = owner.date;\n\n return date[2] ? (\n date[2] + '-' + owner.addLeadingZero(date[1]) + '-' + owner.addLeadingZero(date[0])\n ) : '';\n },\n\n getBlocks: function () {\n return this.blocks;\n },\n\n getValidatedDate: function (value) {\n var owner = this, result = '';\n\n value = value.replace(/[^\\d]/g, '');\n\n owner.blocks.forEach(function (length, index) {\n if (value.length > 0) {\n var sub = value.slice(0, length),\n sub0 = sub.slice(0, 1),\n rest = value.slice(length);\n\n switch (owner.datePattern[index]) {\n case 'd':\n if (sub === '00') {\n sub = '01';\n } else if (parseInt(sub0, 10) > 3) {\n sub = '0' + sub0;\n } else if (parseInt(sub, 10) > 31) {\n sub = '31';\n }\n\n break;\n\n case 'm':\n if (sub === '00') {\n sub = '01';\n } else if (parseInt(sub0, 10) > 1) {\n sub = '0' + sub0;\n } else if (parseInt(sub, 10) > 12) {\n sub = '12';\n }\n\n break;\n }\n\n result += sub;\n\n // update remaining string\n value = rest;\n }\n });\n\n return this.getFixedDateString(result);\n },\n\n getFixedDateString: function (value) {\n var owner = this, datePattern = owner.datePattern, date = [],\n dayIndex = 0, monthIndex = 0, yearIndex = 0,\n dayStartIndex = 0, monthStartIndex = 0, yearStartIndex = 0,\n day, month, year, fullYearDone = false;\n\n // mm-dd || dd-mm\n if (value.length === 4 && datePattern[0].toLowerCase() !== 'y' && datePattern[1].toLowerCase() !== 'y') {\n dayStartIndex = datePattern[0] === 'd' ? 0 : 2;\n monthStartIndex = 2 - dayStartIndex;\n day = parseInt(value.slice(dayStartIndex, dayStartIndex + 2), 10);\n month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);\n\n date = this.getFixedDate(day, month, 0);\n }\n\n // yyyy-mm-dd || yyyy-dd-mm || mm-dd-yyyy || dd-mm-yyyy || dd-yyyy-mm || mm-yyyy-dd\n if (value.length === 8) {\n datePattern.forEach(function (type, index) {\n switch (type) {\n case 'd':\n dayIndex = index;\n break;\n case 'm':\n monthIndex = index;\n break;\n default:\n yearIndex = index;\n break;\n }\n });\n\n yearStartIndex = yearIndex * 2;\n dayStartIndex = (dayIndex <= yearIndex) ? dayIndex * 2 : (dayIndex * 2 + 2);\n monthStartIndex = (monthIndex <= yearIndex) ? monthIndex * 2 : (monthIndex * 2 + 2);\n\n day = parseInt(value.slice(dayStartIndex, dayStartIndex + 2), 10);\n month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);\n year = parseInt(value.slice(yearStartIndex, yearStartIndex + 4), 10);\n\n fullYearDone = value.slice(yearStartIndex, yearStartIndex + 4).length === 4;\n\n date = this.getFixedDate(day, month, year);\n }\n\n // mm-yy || yy-mm\n if (value.length === 4 && (datePattern[0] === 'y' || datePattern[1] === 'y')) {\n monthStartIndex = datePattern[0] === 'm' ? 0 : 2;\n yearStartIndex = 2 - monthStartIndex;\n month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);\n year = parseInt(value.slice(yearStartIndex, yearStartIndex + 2), 10);\n\n fullYearDone = value.slice(yearStartIndex, yearStartIndex + 2).length === 2;\n\n date = [0, month, year];\n }\n\n // mm-yyyy || yyyy-mm\n if (value.length === 6 && (datePattern[0] === 'Y' || datePattern[1] === 'Y')) {\n monthStartIndex = datePattern[0] === 'm' ? 0 : 4;\n yearStartIndex = 2 - 0.5 * monthStartIndex;\n month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10);\n year = parseInt(value.slice(yearStartIndex, yearStartIndex + 4), 10);\n\n fullYearDone = value.slice(yearStartIndex, yearStartIndex + 4).length === 4;\n\n date = [0, month, year];\n }\n\n date = owner.getRangeFixedDate(date);\n owner.date = date;\n\n var result = date.length === 0 ? value : datePattern.reduce(function (previous, current) {\n switch (current) {\n case 'd':\n return previous + (date[0] === 0 ? '' : owner.addLeadingZero(date[0]));\n case 'm':\n return previous + (date[1] === 0 ? '' : owner.addLeadingZero(date[1]));\n case 'y':\n return previous + (fullYearDone ? owner.addLeadingZeroForYear(date[2], false) : '');\n case 'Y':\n return previous + (fullYearDone ? owner.addLeadingZeroForYear(date[2], true) : '');\n }\n }, '');\n\n return result;\n },\n\n getRangeFixedDate: function (date) {\n var owner = this,\n datePattern = owner.datePattern,\n dateMin = owner.dateMin || [],\n dateMax = owner.dateMax || [];\n\n if (!date.length || (dateMin.length < 3 && dateMax.length < 3)) return date;\n\n if (\n datePattern.find(function(x) {\n return x.toLowerCase() === 'y';\n }) &&\n date[2] === 0\n ) return date;\n\n if (dateMax.length && (dateMax[2] < date[2] || (\n dateMax[2] === date[2] && (dateMax[1] < date[1] || (\n dateMax[1] === date[1] && dateMax[0] < date[0]\n ))\n ))) return dateMax;\n\n if (dateMin.length && (dateMin[2] > date[2] || (\n dateMin[2] === date[2] && (dateMin[1] > date[1] || (\n dateMin[1] === date[1] && dateMin[0] > date[0]\n ))\n ))) return dateMin;\n\n return date;\n },\n\n getFixedDate: function (day, month, year) {\n day = Math.min(day, 31);\n month = Math.min(month, 12);\n year = parseInt((year || 0), 10);\n\n if ((month < 7 && month % 2 === 0) || (month > 8 && month % 2 === 1)) {\n day = Math.min(day, month === 2 ? (this.isLeapYear(year) ? 29 : 28) : 30);\n }\n\n return [day, month, year];\n },\n\n isLeapYear: function (year) {\n return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0);\n },\n\n addLeadingZero: function (number) {\n return (number < 10 ? '0' : '') + number;\n },\n\n addLeadingZeroForYear: function (number, fullYearMode) {\n if (fullYearMode) {\n return (number < 10 ? '000' : (number < 100 ? '00' : (number < 1000 ? '0' : ''))) + number;\n }\n\n return (number < 10 ? '0' : '') + number;\n }\n};\n\nvar DateFormatter_1 = DateFormatter;\n\nvar TimeFormatter = function (timePattern, timeFormat) {\n var owner = this;\n\n owner.time = [];\n owner.blocks = [];\n owner.timePattern = timePattern;\n owner.timeFormat = timeFormat;\n owner.initBlocks();\n};\n\nTimeFormatter.prototype = {\n initBlocks: function () {\n var owner = this;\n owner.timePattern.forEach(function () {\n owner.blocks.push(2);\n });\n },\n\n getISOFormatTime: function () {\n var owner = this,\n time = owner.time;\n\n return time[2] ? (\n owner.addLeadingZero(time[0]) + ':' + owner.addLeadingZero(time[1]) + ':' + owner.addLeadingZero(time[2])\n ) : '';\n },\n\n getBlocks: function () {\n return this.blocks;\n },\n\n getTimeFormatOptions: function () {\n var owner = this;\n if (String(owner.timeFormat) === '12') {\n return {\n maxHourFirstDigit: 1,\n maxHours: 12,\n maxMinutesFirstDigit: 5,\n maxMinutes: 60\n };\n }\n\n return {\n maxHourFirstDigit: 2,\n maxHours: 23,\n maxMinutesFirstDigit: 5,\n maxMinutes: 60\n };\n },\n\n getValidatedTime: function (value) {\n var owner = this, result = '';\n\n value = value.replace(/[^\\d]/g, '');\n\n var timeFormatOptions = owner.getTimeFormatOptions();\n\n owner.blocks.forEach(function (length, index) {\n if (value.length > 0) {\n var sub = value.slice(0, length),\n sub0 = sub.slice(0, 1),\n rest = value.slice(length);\n\n switch (owner.timePattern[index]) {\n\n case 'h':\n if (parseInt(sub0, 10) > timeFormatOptions.maxHourFirstDigit) {\n sub = '0' + sub0;\n } else if (parseInt(sub, 10) > timeFormatOptions.maxHours) {\n sub = timeFormatOptions.maxHours + '';\n }\n\n break;\n\n case 'm':\n case 's':\n if (parseInt(sub0, 10) > timeFormatOptions.maxMinutesFirstDigit) {\n sub = '0' + sub0;\n } else if (parseInt(sub, 10) > timeFormatOptions.maxMinutes) {\n sub = timeFormatOptions.maxMinutes + '';\n }\n break;\n }\n\n result += sub;\n\n // update remaining string\n value = rest;\n }\n });\n\n return this.getFixedTimeString(result);\n },\n\n getFixedTimeString: function (value) {\n var owner = this, timePattern = owner.timePattern, time = [],\n secondIndex = 0, minuteIndex = 0, hourIndex = 0,\n secondStartIndex = 0, minuteStartIndex = 0, hourStartIndex = 0,\n second, minute, hour;\n\n if (value.length === 6) {\n timePattern.forEach(function (type, index) {\n switch (type) {\n case 's':\n secondIndex = index * 2;\n break;\n case 'm':\n minuteIndex = index * 2;\n break;\n case 'h':\n hourIndex = index * 2;\n break;\n }\n });\n\n hourStartIndex = hourIndex;\n minuteStartIndex = minuteIndex;\n secondStartIndex = secondIndex;\n\n second = parseInt(value.slice(secondStartIndex, secondStartIndex + 2), 10);\n minute = parseInt(value.slice(minuteStartIndex, minuteStartIndex + 2), 10);\n hour = parseInt(value.slice(hourStartIndex, hourStartIndex + 2), 10);\n\n time = this.getFixedTime(hour, minute, second);\n }\n\n if (value.length === 4 && owner.timePattern.indexOf('s') < 0) {\n timePattern.forEach(function (type, index) {\n switch (type) {\n case 'm':\n minuteIndex = index * 2;\n break;\n case 'h':\n hourIndex = index * 2;\n break;\n }\n });\n\n hourStartIndex = hourIndex;\n minuteStartIndex = minuteIndex;\n\n second = 0;\n minute = parseInt(value.slice(minuteStartIndex, minuteStartIndex + 2), 10);\n hour = parseInt(value.slice(hourStartIndex, hourStartIndex + 2), 10);\n\n time = this.getFixedTime(hour, minute, second);\n }\n\n owner.time = time;\n\n return time.length === 0 ? value : timePattern.reduce(function (previous, current) {\n switch (current) {\n case 's':\n return previous + owner.addLeadingZero(time[2]);\n case 'm':\n return previous + owner.addLeadingZero(time[1]);\n case 'h':\n return previous + owner.addLeadingZero(time[0]);\n }\n }, '');\n },\n\n getFixedTime: function (hour, minute, second) {\n second = Math.min(parseInt(second || 0, 10), 60);\n minute = Math.min(minute, 60);\n hour = Math.min(hour, 60);\n\n return [hour, minute, second];\n },\n\n addLeadingZero: function (number) {\n return (number < 10 ? '0' : '') + number;\n }\n};\n\nvar TimeFormatter_1 = TimeFormatter;\n\nvar PhoneFormatter = function (formatter, delimiter) {\n var owner = this;\n\n owner.delimiter = (delimiter || delimiter === '') ? delimiter : ' ';\n owner.delimiterRE = delimiter ? new RegExp('\\\\' + delimiter, 'g') : '';\n\n owner.formatter = formatter;\n};\n\nPhoneFormatter.prototype = {\n setFormatter: function (formatter) {\n this.formatter = formatter;\n },\n\n format: function (phoneNumber) {\n var owner = this;\n\n owner.formatter.clear();\n\n // only keep number and +\n phoneNumber = phoneNumber.replace(/[^\\d+]/g, '');\n\n // strip non-leading +\n phoneNumber = phoneNumber.replace(/^\\+/, 'B').replace(/\\+/g, '').replace('B', '+');\n\n // strip delimiter\n phoneNumber = phoneNumber.replace(owner.delimiterRE, '');\n\n var result = '', current, validated = false;\n\n for (var i = 0, iMax = phoneNumber.length; i < iMax; i++) {\n current = owner.formatter.inputDigit(phoneNumber.charAt(i));\n\n // has ()- or space inside\n if (/[\\s()-]/g.test(current)) {\n result = current;\n\n validated = true;\n } else {\n if (!validated) {\n result = current;\n }\n // else: over length input\n // it turns to invalid number again\n }\n }\n\n // strip ()\n // e.g. US: 7161234567 returns (716) 123-4567\n result = result.replace(/[()]/g, '');\n // replace library delimiter with user customized delimiter\n result = result.replace(/[\\s-]/g, owner.delimiter);\n\n return result;\n }\n};\n\nvar PhoneFormatter_1 = PhoneFormatter;\n\nvar CreditCardDetector = {\n blocks: {\n uatp: [4, 5, 6],\n amex: [4, 6, 5],\n diners: [4, 6, 4],\n discover: [4, 4, 4, 4],\n mastercard: [4, 4, 4, 4],\n dankort: [4, 4, 4, 4],\n instapayment: [4, 4, 4, 4],\n jcb15: [4, 6, 5],\n jcb: [4, 4, 4, 4],\n maestro: [4, 4, 4, 4],\n visa: [4, 4, 4, 4],\n mir: [4, 4, 4, 4],\n unionPay: [4, 4, 4, 4],\n general: [4, 4, 4, 4]\n },\n\n re: {\n // starts with 1; 15 digits, not starts with 1800 (jcb card)\n uatp: /^(?!1800)1\\d{0,14}/,\n\n // starts with 34/37; 15 digits\n amex: /^3[47]\\d{0,13}/,\n\n // starts with 6011/65/644-649; 16 digits\n discover: /^(?:6011|65\\d{0,2}|64[4-9]\\d?)\\d{0,12}/,\n\n // starts with 300-305/309 or 36/38/39; 14 digits\n diners: /^3(?:0([0-5]|9)|[689]\\d?)\\d{0,11}/,\n\n // starts with 51-55/2221–2720; 16 digits\n mastercard: /^(5[1-5]\\d{0,2}|22[2-9]\\d{0,1}|2[3-7]\\d{0,2})\\d{0,12}/,\n\n // starts with 5019/4175/4571; 16 digits\n dankort: /^(5019|4175|4571)\\d{0,12}/,\n\n // starts with 637-639; 16 digits\n instapayment: /^63[7-9]\\d{0,13}/,\n\n // starts with 2131/1800; 15 digits\n jcb15: /^(?:2131|1800)\\d{0,11}/,\n\n // starts with 2131/1800/35; 16 digits\n jcb: /^(?:35\\d{0,2})\\d{0,12}/,\n\n // starts with 50/56-58/6304/67; 16 digits\n maestro: /^(?:5[0678]\\d{0,2}|6304|67\\d{0,2})\\d{0,12}/,\n\n // starts with 22; 16 digits\n mir: /^220[0-4]\\d{0,12}/,\n\n // starts with 4; 16 digits\n visa: /^4\\d{0,15}/,\n\n // starts with 62/81; 16 digits\n unionPay: /^(62|81)\\d{0,14}/\n },\n\n getStrictBlocks: function (block) {\n var total = block.reduce(function (prev, current) {\n return prev + current;\n }, 0);\n\n return block.concat(19 - total);\n },\n\n getInfo: function (value, strictMode) {\n var blocks = CreditCardDetector.blocks,\n re = CreditCardDetector.re;\n\n // Some credit card can have up to 19 digits number.\n // Set strictMode to true will remove the 16 max-length restrain,\n // however, I never found any website validate card number like\n // this, hence probably you don't want to enable this option.\n strictMode = !!strictMode;\n\n for (var key in re) {\n if (re[key].test(value)) {\n var matchedBlocks = blocks[key];\n return {\n type: key,\n blocks: strictMode ? this.getStrictBlocks(matchedBlocks) : matchedBlocks\n };\n }\n }\n\n return {\n type: 'unknown',\n blocks: strictMode ? this.getStrictBlocks(blocks.general) : blocks.general\n };\n }\n};\n\nvar CreditCardDetector_1 = CreditCardDetector;\n\nvar Util = {\n noop: function () {\n },\n\n strip: function (value, re) {\n return value.replace(re, '');\n },\n\n getPostDelimiter: function (value, delimiter, delimiters) {\n // single delimiter\n if (delimiters.length === 0) {\n return value.slice(-delimiter.length) === delimiter ? delimiter : '';\n }\n\n // multiple delimiters\n var matchedDelimiter = '';\n delimiters.forEach(function (current) {\n if (value.slice(-current.length) === current) {\n matchedDelimiter = current;\n }\n });\n\n return matchedDelimiter;\n },\n\n getDelimiterREByDelimiter: function (delimiter) {\n return new RegExp(delimiter.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1'), 'g');\n },\n\n getNextCursorPosition: function (prevPos, oldValue, newValue, delimiter, delimiters) {\n // If cursor was at the end of value, just place it back.\n // Because new value could contain additional chars.\n if (oldValue.length === prevPos) {\n return newValue.length;\n }\n\n return prevPos + this.getPositionOffset(prevPos, oldValue, newValue, delimiter ,delimiters);\n },\n\n getPositionOffset: function (prevPos, oldValue, newValue, delimiter, delimiters) {\n var oldRawValue, newRawValue, lengthOffset;\n\n oldRawValue = this.stripDelimiters(oldValue.slice(0, prevPos), delimiter, delimiters);\n newRawValue = this.stripDelimiters(newValue.slice(0, prevPos), delimiter, delimiters);\n lengthOffset = oldRawValue.length - newRawValue.length;\n\n return (lengthOffset !== 0) ? (lengthOffset / Math.abs(lengthOffset)) : 0;\n },\n\n stripDelimiters: function (value, delimiter, delimiters) {\n var owner = this;\n\n // single delimiter\n if (delimiters.length === 0) {\n var delimiterRE = delimiter ? owner.getDelimiterREByDelimiter(delimiter) : '';\n\n return value.replace(delimiterRE, '');\n }\n\n // multiple delimiters\n delimiters.forEach(function (current) {\n current.split('').forEach(function (letter) {\n value = value.replace(owner.getDelimiterREByDelimiter(letter), '');\n });\n });\n\n return value;\n },\n\n headStr: function (str, length) {\n return str.slice(0, length);\n },\n\n getMaxLength: function (blocks) {\n return blocks.reduce(function (previous, current) {\n return previous + current;\n }, 0);\n },\n\n // strip prefix\n // Before type | After type | Return value\n // PEFIX-... | PEFIX-... | ''\n // PREFIX-123 | PEFIX-123 | 123\n // PREFIX-123 | PREFIX-23 | 23\n // PREFIX-123 | PREFIX-1234 | 1234\n getPrefixStrippedValue: function (value, prefix, prefixLength, prevResult, delimiter, delimiters, noImmediatePrefix, tailPrefix, signBeforePrefix) {\n // No prefix\n if (prefixLength === 0) {\n return value;\n }\n\n // Value is prefix\n if (value === prefix && value !== '') {\n return '';\n }\n\n if (signBeforePrefix && (value.slice(0, 1) == '-')) {\n var prev = (prevResult.slice(0, 1) == '-') ? prevResult.slice(1) : prevResult;\n return '-' + this.getPrefixStrippedValue(value.slice(1), prefix, prefixLength, prev, delimiter, delimiters, noImmediatePrefix, tailPrefix, signBeforePrefix);\n }\n\n // Pre result prefix string does not match pre-defined prefix\n if (prevResult.slice(0, prefixLength) !== prefix && !tailPrefix) {\n // Check if the first time user entered something\n if (noImmediatePrefix && !prevResult && value) return value;\n return '';\n } else if (prevResult.slice(-prefixLength) !== prefix && tailPrefix) {\n // Check if the first time user entered something\n if (noImmediatePrefix && !prevResult && value) return value;\n return '';\n }\n\n var prevValue = this.stripDelimiters(prevResult, delimiter, delimiters);\n\n // New value has issue, someone typed in between prefix letters\n // Revert to pre value\n if (value.slice(0, prefixLength) !== prefix && !tailPrefix) {\n return prevValue.slice(prefixLength);\n } else if (value.slice(-prefixLength) !== prefix && tailPrefix) {\n return prevValue.slice(0, -prefixLength - 1);\n }\n\n // No issue, strip prefix for new value\n return tailPrefix ? value.slice(0, -prefixLength) : value.slice(prefixLength);\n },\n\n getFirstDiffIndex: function (prev, current) {\n var index = 0;\n\n while (prev.charAt(index) === current.charAt(index)) {\n if (prev.charAt(index++) === '') {\n return -1;\n }\n }\n\n return index;\n },\n\n getFormattedValue: function (value, blocks, blocksLength, delimiter, delimiters, delimiterLazyShow) {\n var result = '',\n multipleDelimiters = delimiters.length > 0,\n currentDelimiter = '';\n\n // no options, normal input\n if (blocksLength === 0) {\n return value;\n }\n\n blocks.forEach(function (length, index) {\n if (value.length > 0) {\n var sub = value.slice(0, length),\n rest = value.slice(length);\n\n if (multipleDelimiters) {\n currentDelimiter = delimiters[delimiterLazyShow ? (index - 1) : index] || currentDelimiter;\n } else {\n currentDelimiter = delimiter;\n }\n\n if (delimiterLazyShow) {\n if (index > 0) {\n result += currentDelimiter;\n }\n\n result += sub;\n } else {\n result += sub;\n\n if (sub.length === length && index < blocksLength - 1) {\n result += currentDelimiter;\n }\n }\n\n // update remaining string\n value = rest;\n }\n });\n\n return result;\n },\n\n // move cursor to the end\n // the first time user focuses on an input with prefix\n fixPrefixCursor: function (el, prefix, delimiter, delimiters) {\n if (!el) {\n return;\n }\n\n var val = el.value,\n appendix = delimiter || (delimiters[0] || ' ');\n\n if (!el.setSelectionRange || !prefix || (prefix.length + appendix.length) <= val.length) {\n return;\n }\n\n var len = val.length * 2;\n\n // set timeout to avoid blink\n setTimeout(function () {\n el.setSelectionRange(len, len);\n }, 1);\n },\n\n // Check if input field is fully selected\n checkFullSelection: function(value) {\n try {\n var selection = window.getSelection() || document.getSelection() || {};\n return selection.toString().length === value.length;\n } catch (ex) {\n // Ignore\n }\n\n return false;\n },\n\n setSelection: function (element, position, doc) {\n if (element !== this.getActiveElement(doc)) {\n return;\n }\n\n // cursor is already in the end\n if (element && element.value.length <= position) {\n return;\n }\n\n if (element.createTextRange) {\n var range = element.createTextRange();\n\n range.move('character', position);\n range.select();\n } else {\n try {\n element.setSelectionRange(position, position);\n } catch (e) {\n // eslint-disable-next-line\n console.warn('The input element type does not support selection');\n }\n }\n },\n\n getActiveElement: function(parent) {\n var activeElement = parent.activeElement;\n if (activeElement && activeElement.shadowRoot) {\n return this.getActiveElement(activeElement.shadowRoot);\n }\n return activeElement;\n },\n\n isAndroid: function () {\n return navigator && /android/i.test(navigator.userAgent);\n },\n\n // On Android chrome, the keyup and keydown events\n // always return key code 229 as a composition that\n // buffers the user’s keystrokes\n // see https://github.com/nosir/cleave.js/issues/147\n isAndroidBackspaceKeydown: function (lastInputValue, currentInputValue) {\n if (!this.isAndroid() || !lastInputValue || !currentInputValue) {\n return false;\n }\n\n return currentInputValue === lastInputValue.slice(0, -1);\n }\n};\n\nvar Util_1 = Util;\n\n/**\n * Props Assignment\n *\n * Separate this, so react module can share the usage\n */\nvar DefaultProperties = {\n // Maybe change to object-assign\n // for now just keep it as simple\n assign: function (target, opts) {\n target = target || {};\n opts = opts || {};\n\n // credit card\n target.creditCard = !!opts.creditCard;\n target.creditCardStrictMode = !!opts.creditCardStrictMode;\n target.creditCardType = '';\n target.onCreditCardTypeChanged = opts.onCreditCardTypeChanged || (function () {});\n\n // phone\n target.phone = !!opts.phone;\n target.phoneRegionCode = opts.phoneRegionCode || 'AU';\n target.phoneFormatter = {};\n\n // time\n target.time = !!opts.time;\n target.timePattern = opts.timePattern || ['h', 'm', 's'];\n target.timeFormat = opts.timeFormat || '24';\n target.timeFormatter = {};\n\n // date\n target.date = !!opts.date;\n target.datePattern = opts.datePattern || ['d', 'm', 'Y'];\n target.dateMin = opts.dateMin || '';\n target.dateMax = opts.dateMax || '';\n target.dateFormatter = {};\n\n // numeral\n target.numeral = !!opts.numeral;\n target.numeralIntegerScale = opts.numeralIntegerScale > 0 ? opts.numeralIntegerScale : 0;\n target.numeralDecimalScale = opts.numeralDecimalScale >= 0 ? opts.numeralDecimalScale : 2;\n target.numeralDecimalMark = opts.numeralDecimalMark || '.';\n target.numeralThousandsGroupStyle = opts.numeralThousandsGroupStyle || 'thousand';\n target.numeralPositiveOnly = !!opts.numeralPositiveOnly;\n target.stripLeadingZeroes = opts.stripLeadingZeroes !== false;\n target.signBeforePrefix = !!opts.signBeforePrefix;\n target.tailPrefix = !!opts.tailPrefix;\n\n // others\n target.swapHiddenInput = !!opts.swapHiddenInput;\n \n target.numericOnly = target.creditCard || target.date || !!opts.numericOnly;\n\n target.uppercase = !!opts.uppercase;\n target.lowercase = !!opts.lowercase;\n\n target.prefix = (target.creditCard || target.date) ? '' : (opts.prefix || '');\n target.noImmediatePrefix = !!opts.noImmediatePrefix;\n target.prefixLength = target.prefix.length;\n target.rawValueTrimPrefix = !!opts.rawValueTrimPrefix;\n target.copyDelimiter = !!opts.copyDelimiter;\n\n target.initValue = (opts.initValue !== undefined && opts.initValue !== null) ? opts.initValue.toString() : '';\n\n target.delimiter =\n (opts.delimiter || opts.delimiter === '') ? opts.delimiter :\n (opts.date ? '/' :\n (opts.time ? ':' :\n (opts.numeral ? ',' :\n (opts.phone ? ' ' :\n ' '))));\n target.delimiterLength = target.delimiter.length;\n target.delimiterLazyShow = !!opts.delimiterLazyShow;\n target.delimiters = opts.delimiters || [];\n\n target.blocks = opts.blocks || [];\n target.blocksLength = target.blocks.length;\n\n target.root = (typeof commonjsGlobal === 'object' && commonjsGlobal) ? commonjsGlobal : window;\n target.document = opts.document || target.root.document;\n\n target.maxLength = 0;\n\n target.backspace = false;\n target.result = '';\n\n target.onValueChanged = opts.onValueChanged || (function () {});\n\n return target;\n }\n};\n\nvar DefaultProperties_1 = DefaultProperties;\n\n/**\n * Construct a new Cleave instance by passing the configuration object\n *\n * @param {String | HTMLElement} element\n * @param {Object} opts\n */\nvar Cleave = function (element, opts) {\n var owner = this;\n var hasMultipleElements = false;\n\n if (typeof element === 'string') {\n owner.element = document.querySelector(element);\n hasMultipleElements = document.querySelectorAll(element).length > 1;\n } else {\n if (typeof element.length !== 'undefined' && element.length > 0) {\n owner.element = element[0];\n hasMultipleElements = element.length > 1;\n } else {\n owner.element = element;\n }\n }\n\n if (!owner.element) {\n throw new Error('[cleave.js] Please check the element');\n }\n\n if (hasMultipleElements) {\n try {\n // eslint-disable-next-line\n console.warn('[cleave.js] Multiple input fields matched, cleave.js will only take the first one.');\n } catch (e) {\n // Old IE\n }\n }\n\n opts.initValue = owner.element.value;\n\n owner.properties = Cleave.DefaultProperties.assign({}, opts);\n\n owner.init();\n};\n\nCleave.prototype = {\n init: function () {\n var owner = this, pps = owner.properties;\n\n // no need to use this lib\n if (!pps.numeral && !pps.phone && !pps.creditCard && !pps.time && !pps.date && (pps.blocksLength === 0 && !pps.prefix)) {\n owner.onInput(pps.initValue);\n\n return;\n }\n\n pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);\n\n owner.isAndroid = Cleave.Util.isAndroid();\n owner.lastInputValue = '';\n owner.isBackward = '';\n\n owner.onChangeListener = owner.onChange.bind(owner);\n owner.onKeyDownListener = owner.onKeyDown.bind(owner);\n owner.onFocusListener = owner.onFocus.bind(owner);\n owner.onCutListener = owner.onCut.bind(owner);\n owner.onCopyListener = owner.onCopy.bind(owner);\n\n owner.initSwapHiddenInput();\n\n owner.element.addEventListener('input', owner.onChangeListener);\n owner.element.addEventListener('keydown', owner.onKeyDownListener);\n owner.element.addEventListener('focus', owner.onFocusListener);\n owner.element.addEventListener('cut', owner.onCutListener);\n owner.element.addEventListener('copy', owner.onCopyListener);\n\n\n owner.initPhoneFormatter();\n owner.initDateFormatter();\n owner.initTimeFormatter();\n owner.initNumeralFormatter();\n\n // avoid touch input field if value is null\n // otherwise Firefox will add red box-shadow for
\n if (pps.initValue || (pps.prefix && !pps.noImmediatePrefix)) {\n owner.onInput(pps.initValue);\n }\n },\n\n initSwapHiddenInput: function () {\n var owner = this, pps = owner.properties;\n if (!pps.swapHiddenInput) return;\n\n var inputFormatter = owner.element.cloneNode(true);\n owner.element.parentNode.insertBefore(inputFormatter, owner.element);\n\n owner.elementSwapHidden = owner.element;\n owner.elementSwapHidden.type = 'hidden';\n\n owner.element = inputFormatter;\n owner.element.id = '';\n },\n\n initNumeralFormatter: function () {\n var owner = this, pps = owner.properties;\n\n if (!pps.numeral) {\n return;\n }\n\n pps.numeralFormatter = new Cleave.NumeralFormatter(\n pps.numeralDecimalMark,\n pps.numeralIntegerScale,\n pps.numeralDecimalScale,\n pps.numeralThousandsGroupStyle,\n pps.numeralPositiveOnly,\n pps.stripLeadingZeroes,\n pps.prefix,\n pps.signBeforePrefix,\n pps.tailPrefix,\n pps.delimiter\n );\n },\n\n initTimeFormatter: function() {\n var owner = this, pps = owner.properties;\n\n if (!pps.time) {\n return;\n }\n\n pps.timeFormatter = new Cleave.TimeFormatter(pps.timePattern, pps.timeFormat);\n pps.blocks = pps.timeFormatter.getBlocks();\n pps.blocksLength = pps.blocks.length;\n pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);\n },\n\n initDateFormatter: function () {\n var owner = this, pps = owner.properties;\n\n if (!pps.date) {\n return;\n }\n\n pps.dateFormatter = new Cleave.DateFormatter(pps.datePattern, pps.dateMin, pps.dateMax);\n pps.blocks = pps.dateFormatter.getBlocks();\n pps.blocksLength = pps.blocks.length;\n pps.maxLength = Cleave.Util.getMaxLength(pps.blocks);\n },\n\n initPhoneFormatter: function () {\n var owner = this, pps = owner.properties;\n\n if (!pps.phone) {\n return;\n }\n\n // Cleave.AsYouTypeFormatter should be provided by\n // external google closure lib\n try {\n pps.phoneFormatter = new Cleave.PhoneFormatter(\n new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),\n pps.delimiter\n );\n } catch (ex) {\n throw new Error('[cleave.js] Please include phone-type-formatter.{country}.js lib');\n }\n },\n\n onKeyDown: function (event) {\n var owner = this,\n charCode = event.which || event.keyCode;\n\n owner.lastInputValue = owner.element.value;\n owner.isBackward = charCode === 8;\n },\n\n onChange: function (event) {\n var owner = this, pps = owner.properties,\n Util = Cleave.Util;\n\n owner.isBackward = owner.isBackward || event.inputType === 'deleteContentBackward';\n\n var postDelimiter = Util.getPostDelimiter(owner.lastInputValue, pps.delimiter, pps.delimiters);\n\n if (owner.isBackward && postDelimiter) {\n pps.postDelimiterBackspace = postDelimiter;\n } else {\n pps.postDelimiterBackspace = false;\n }\n\n this.onInput(this.element.value);\n },\n\n onFocus: function () {\n var owner = this,\n pps = owner.properties;\n owner.lastInputValue = owner.element.value;\n\n if (pps.prefix && pps.noImmediatePrefix && !owner.element.value) {\n this.onInput(pps.prefix);\n }\n\n Cleave.Util.fixPrefixCursor(owner.element, pps.prefix, pps.delimiter, pps.delimiters);\n },\n\n onCut: function (e) {\n if (!Cleave.Util.checkFullSelection(this.element.value)) return;\n this.copyClipboardData(e);\n this.onInput('');\n },\n\n onCopy: function (e) {\n if (!Cleave.Util.checkFullSelection(this.element.value)) return;\n this.copyClipboardData(e);\n },\n\n copyClipboardData: function (e) {\n var owner = this,\n pps = owner.properties,\n Util = Cleave.Util,\n inputValue = owner.element.value,\n textToCopy = '';\n\n if (!pps.copyDelimiter) {\n textToCopy = Util.stripDelimiters(inputValue, pps.delimiter, pps.delimiters);\n } else {\n textToCopy = inputValue;\n }\n\n try {\n if (e.clipboardData) {\n e.clipboardData.setData('Text', textToCopy);\n } else {\n window.clipboardData.setData('Text', textToCopy);\n }\n\n e.preventDefault();\n } catch (ex) {\n // empty\n }\n },\n\n onInput: function (value) {\n var owner = this, pps = owner.properties,\n Util = Cleave.Util;\n\n // case 1: delete one more character \"4\"\n // 1234*| -> hit backspace -> 123|\n // case 2: last character is not delimiter which is:\n // 12|34* -> hit backspace -> 1|34*\n // note: no need to apply this for numeral mode\n var postDelimiterAfter = Util.getPostDelimiter(value, pps.delimiter, pps.delimiters);\n if (!pps.numeral && pps.postDelimiterBackspace && !postDelimiterAfter) {\n value = Util.headStr(value, value.length - pps.postDelimiterBackspace.length);\n }\n\n // phone formatter\n if (pps.phone) {\n if (pps.prefix && (!pps.noImmediatePrefix || value.length)) {\n pps.result = pps.prefix + pps.phoneFormatter.format(value).slice(pps.prefix.length);\n } else {\n pps.result = pps.phoneFormatter.format(value);\n }\n owner.updateValueState();\n\n return;\n }\n\n // numeral formatter\n if (pps.numeral) {\n // Do not show prefix when noImmediatePrefix is specified\n // This mostly because we need to show user the native input placeholder\n if (pps.prefix && pps.noImmediatePrefix && value.length === 0) {\n pps.result = '';\n } else {\n pps.result = pps.numeralFormatter.format(value);\n }\n owner.updateValueState();\n\n return;\n }\n\n // date\n if (pps.date) {\n value = pps.dateFormatter.getValidatedDate(value);\n }\n\n // time\n if (pps.time) {\n value = pps.timeFormatter.getValidatedTime(value);\n }\n\n // strip delimiters\n value = Util.stripDelimiters(value, pps.delimiter, pps.delimiters);\n\n // strip prefix\n value = Util.getPrefixStrippedValue(value, pps.prefix, pps.prefixLength, pps.result, pps.delimiter, pps.delimiters, pps.noImmediatePrefix, pps.tailPrefix, pps.signBeforePrefix);\n\n // strip non-numeric characters\n value = pps.numericOnly ? Util.strip(value, /[^\\d]/g) : value;\n\n // convert case\n value = pps.uppercase ? value.toUpperCase() : value;\n value = pps.lowercase ? value.toLowerCase() : value;\n\n // prevent from showing prefix when no immediate option enabled with empty input value\n if (pps.prefix) {\n if (pps.tailPrefix) {\n value = value + pps.prefix;\n } else {\n value = pps.prefix + value;\n }\n\n\n // no blocks specified, no need to do formatting\n if (pps.blocksLength === 0) {\n pps.result = value;\n owner.updateValueState();\n\n return;\n }\n }\n\n // update credit card props\n if (pps.creditCard) {\n owner.updateCreditCardPropsByValue(value);\n }\n\n // strip over length characters\n value = Util.headStr(value, pps.maxLength);\n\n // apply blocks\n pps.result = Util.getFormattedValue(\n value,\n pps.blocks, pps.blocksLength,\n pps.delimiter, pps.delimiters, pps.delimiterLazyShow\n );\n\n owner.updateValueState();\n },\n\n updateCreditCardPropsByValue: function (value) {\n var owner = this, pps = owner.properties,\n Util = Cleave.Util,\n creditCardInfo;\n\n // At least one of the first 4 characters has changed\n if (Util.headStr(pps.result, 4) === Util.headStr(value, 4)) {\n return;\n }\n\n creditCardInfo = Cleave.CreditCardDetector.getInfo(value, pps.creditCardStrictMode);\n\n pps.blocks = creditCardInfo.blocks;\n pps.blocksLength = pps.blocks.length;\n pps.maxLength = Util.getMaxLength(pps.blocks);\n\n // credit card type changed\n if (pps.creditCardType !== creditCardInfo.type) {\n pps.creditCardType = creditCardInfo.type;\n\n pps.onCreditCardTypeChanged.call(owner, pps.creditCardType);\n }\n },\n\n updateValueState: function () {\n var owner = this,\n Util = Cleave.Util,\n pps = owner.properties;\n\n if (!owner.element) {\n return;\n }\n\n var endPos = owner.element.selectionEnd;\n var oldValue = owner.element.value;\n var newValue = pps.result;\n\n endPos = Util.getNextCursorPosition(endPos, oldValue, newValue, pps.delimiter, pps.delimiters);\n\n // fix Android browser type=\"text\" input field\n // cursor not jumping issue\n if (owner.isAndroid) {\n window.setTimeout(function () {\n owner.element.value = newValue;\n Util.setSelection(owner.element, endPos, pps.document, false);\n owner.callOnValueChanged();\n }, 1);\n\n return;\n }\n\n owner.element.value = newValue;\n if (pps.swapHiddenInput) owner.elementSwapHidden.value = owner.getRawValue();\n\n Util.setSelection(owner.element, endPos, pps.document, false);\n owner.callOnValueChanged();\n },\n\n callOnValueChanged: function () {\n var owner = this,\n pps = owner.properties;\n\n pps.onValueChanged.call(owner, {\n target: {\n name: owner.element.name,\n value: pps.result,\n rawValue: owner.getRawValue()\n }\n });\n },\n\n setPhoneRegionCode: function (phoneRegionCode) {\n var owner = this, pps = owner.properties;\n\n pps.phoneRegionCode = phoneRegionCode;\n owner.initPhoneFormatter();\n owner.onChange();\n },\n\n setRawValue: function (value) {\n var owner = this, pps = owner.properties;\n\n value = value !== undefined && value !== null ? value.toString() : '';\n\n if (pps.numeral) {\n value = value.replace('.', pps.numeralDecimalMark);\n }\n\n pps.postDelimiterBackspace = false;\n\n owner.element.value = value;\n owner.onInput(value);\n },\n\n getRawValue: function () {\n var owner = this,\n pps = owner.properties,\n Util = Cleave.Util,\n rawValue = owner.element.value;\n\n if (pps.rawValueTrimPrefix) {\n rawValue = Util.getPrefixStrippedValue(rawValue, pps.prefix, pps.prefixLength, pps.result, pps.delimiter, pps.delimiters, pps.noImmediatePrefix, pps.tailPrefix, pps.signBeforePrefix);\n }\n\n if (pps.numeral) {\n rawValue = pps.numeralFormatter.getRawValue(rawValue);\n } else {\n rawValue = Util.stripDelimiters(rawValue, pps.delimiter, pps.delimiters);\n }\n\n return rawValue;\n },\n\n getISOFormatDate: function () {\n var owner = this,\n pps = owner.properties;\n\n return pps.date ? pps.dateFormatter.getISOFormatDate() : '';\n },\n\n getISOFormatTime: function () {\n var owner = this,\n pps = owner.properties;\n\n return pps.time ? pps.timeFormatter.getISOFormatTime() : '';\n },\n\n getFormattedValue: function () {\n return this.element.value;\n },\n\n destroy: function () {\n var owner = this;\n\n owner.element.removeEventListener('input', owner.onChangeListener);\n owner.element.removeEventListener('keydown', owner.onKeyDownListener);\n owner.element.removeEventListener('focus', owner.onFocusListener);\n owner.element.removeEventListener('cut', owner.onCutListener);\n owner.element.removeEventListener('copy', owner.onCopyListener);\n },\n\n toString: function () {\n return '[Cleave Object]';\n }\n};\n\nCleave.NumeralFormatter = NumeralFormatter_1;\nCleave.DateFormatter = DateFormatter_1;\nCleave.TimeFormatter = TimeFormatter_1;\nCleave.PhoneFormatter = PhoneFormatter_1;\nCleave.CreditCardDetector = CreditCardDetector_1;\nCleave.Util = Util_1;\nCleave.DefaultProperties = DefaultProperties_1;\n\n// for angular directive\n((typeof commonjsGlobal === 'object' && commonjsGlobal) ? commonjsGlobal : window)['Cleave'] = Cleave;\n\n// CommonJS\nvar Cleave_1 = Cleave;\n\nexport default Cleave_1;\n","/**\r\n * DevExtreme (esm/localization/ldml/date.format.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport numberLocalization from \"../number\";\r\nvar ARABIC_COMMA = \"\\u060c\";\r\nvar FORMAT_SEPARATORS = \" .,:;/\\\\<>()-[]\" + ARABIC_COMMA;\r\nvar AM_PM_PATTERN = \". m.\";\r\nvar checkDigit = function(char) {\r\n var code = char && numberLocalization.convertDigits(char, false).charCodeAt(0);\r\n var zeroCode = numberLocalization.convertDigits(\"0\", false).charCodeAt(0);\r\n return zeroCode <= code && code < zeroCode + 10\r\n};\r\nvar checkPatternContinue = function(text, patterns, index, isDigit) {\r\n var char = text[index];\r\n var nextChar = text[index + 1];\r\n if (!isDigit) {\r\n if (\".\" === char || \" \" === char && text.slice(index - 1, index + 3) === AM_PM_PATTERN) {\r\n return true\r\n }\r\n if (\"-\" === char && !checkDigit(nextChar)) {\r\n return true\r\n }\r\n }\r\n var isDigitChanged = isDigit && patterns.some(pattern => text[index] !== pattern[index]);\r\n return FORMAT_SEPARATORS.indexOf(char) < 0 && isDigit === checkDigit(char) && (!isDigit || isDigitChanged)\r\n};\r\nvar getPatternStartIndex = function(defaultPattern, index) {\r\n if (!checkDigit(defaultPattern[index])) {\r\n while (index > 0 && !checkDigit(defaultPattern[index - 1]) && (\".\" === defaultPattern[index - 1] || FORMAT_SEPARATORS.indexOf(defaultPattern[index - 1]) < 0)) {\r\n index--\r\n }\r\n }\r\n return index\r\n};\r\nvar getDifference = function(defaultPattern, patterns, processedIndexes, isDigit) {\r\n var i = 0;\r\n var result = [];\r\n var patternsFilter = function(pattern) {\r\n return defaultPattern[i] !== pattern[i] && (void 0 === isDigit || checkDigit(defaultPattern[i]) === isDigit)\r\n };\r\n if (!Array.isArray(patterns)) {\r\n patterns = [patterns]\r\n }\r\n for (i = 0; i < defaultPattern.length; i++) {\r\n if (processedIndexes.indexOf(i) < 0 && patterns.filter(patternsFilter).length) {\r\n i = getPatternStartIndex(defaultPattern, i);\r\n do {\r\n isDigit = checkDigit(defaultPattern[i]);\r\n if (!result.length && !isDigit && checkDigit(patterns[0][i])) {\r\n break\r\n }\r\n result.push(i);\r\n processedIndexes.unshift(i);\r\n i++\r\n } while (defaultPattern[i] && checkPatternContinue(defaultPattern, patterns, i, isDigit));\r\n break\r\n }\r\n }\r\n if (1 === result.length && (\"0\" === defaultPattern[processedIndexes[0] - 1] || \"\\u0660\" === defaultPattern[processedIndexes[0] - 1])) {\r\n processedIndexes.unshift(processedIndexes[0] - 1)\r\n }\r\n return result\r\n};\r\nvar replaceCharsCore = function(pattern, indexes, char, patternPositions) {\r\n var baseCharIndex = indexes[0];\r\n var patternIndex = baseCharIndex < patternPositions.length ? patternPositions[baseCharIndex] : baseCharIndex;\r\n indexes.forEach((function(_, index) {\r\n pattern = pattern.substr(0, patternIndex + index) + (char.length > 1 ? char[index] : char) + pattern.substr(patternIndex + index + 1)\r\n }));\r\n if (1 === indexes.length) {\r\n pattern = pattern.replace(\"0\" + char, char + char);\r\n pattern = pattern.replace(\"\\u0660\" + char, char + char)\r\n }\r\n return pattern\r\n};\r\nvar replaceChars = function(pattern, indexes, char, patternPositions) {\r\n var i;\r\n var index;\r\n var patternIndex;\r\n if (!checkDigit(pattern[indexes[0]] || \"0\")) {\r\n var letterCount = Math.max(indexes.length <= 3 ? 3 : 4, char.length);\r\n while (indexes.length > letterCount) {\r\n index = indexes.pop();\r\n patternIndex = patternPositions[index];\r\n patternPositions[index] = -1;\r\n for (i = index + 1; i < patternPositions.length; i++) {\r\n patternPositions[i]--\r\n }\r\n pattern = pattern.substr(0, patternIndex) + pattern.substr(patternIndex + 1)\r\n }\r\n index = indexes[indexes.length - 1] + 1, patternIndex = index < patternPositions.length ? patternPositions[index] : index;\r\n while (indexes.length < letterCount) {\r\n indexes.push(indexes[indexes.length - 1] + 1);\r\n for (i = index; i < patternPositions.length; i++) {\r\n patternPositions[i]++\r\n }\r\n pattern = pattern.substr(0, patternIndex) + \" \" + pattern.substr(patternIndex)\r\n }\r\n }\r\n pattern = replaceCharsCore(pattern, indexes, char, patternPositions);\r\n return pattern\r\n};\r\nvar formatValue = function(value, formatter) {\r\n if (Array.isArray(value)) {\r\n return value.map((function(value) {\r\n return (formatter(value) || \"\").toString()\r\n }))\r\n }\r\n return (formatter(value) || \"\").toString()\r\n};\r\nvar ESCAPE_CHARS_REGEXP = /[a-zA-Z]/g;\r\nvar escapeChars = function(pattern, defaultPattern, processedIndexes, patternPositions) {\r\n var escapeIndexes = defaultPattern.split(\"\").map((function(char, index) {\r\n if (processedIndexes.indexOf(index) < 0 && (char.match(ESCAPE_CHARS_REGEXP) || \"'\" === char)) {\r\n return patternPositions[index]\r\n }\r\n return -1\r\n }));\r\n pattern = pattern.split(\"\").map((function(char, index) {\r\n var result = char;\r\n var isCurrentCharEscaped = escapeIndexes.indexOf(index) >= 0;\r\n var isPrevCharEscaped = index > 0 && escapeIndexes.indexOf(index - 1) >= 0;\r\n var isNextCharEscaped = escapeIndexes.indexOf(index + 1) >= 0;\r\n if (isCurrentCharEscaped) {\r\n if (!isPrevCharEscaped) {\r\n result = \"'\" + result\r\n }\r\n if (!isNextCharEscaped) {\r\n result += \"'\"\r\n }\r\n }\r\n return result\r\n })).join(\"\");\r\n return pattern\r\n};\r\nexport var getFormat = function(formatter) {\r\n var processedIndexes = [];\r\n var defaultPattern = formatValue(new Date(2009, 8, 8, 6, 5, 4), formatter);\r\n var patternPositions = defaultPattern.split(\"\").map((function(_, index) {\r\n return index\r\n }));\r\n var result = defaultPattern;\r\n var replacedPatterns = {};\r\n var datePatterns = [{\r\n date: new Date(2009, 8, 8, 6, 5, 4, 111),\r\n pattern: \"S\"\r\n }, {\r\n date: new Date(2009, 8, 8, 6, 5, 2),\r\n pattern: \"s\"\r\n }, {\r\n date: new Date(2009, 8, 8, 6, 2, 4),\r\n pattern: \"m\"\r\n }, {\r\n date: new Date(2009, 8, 8, 18, 5, 4),\r\n pattern: \"H\",\r\n isDigit: true\r\n }, {\r\n date: new Date(2009, 8, 8, 2, 5, 4),\r\n pattern: \"h\",\r\n isDigit: true\r\n }, {\r\n date: new Date(2009, 8, 8, 18, 5, 4),\r\n pattern: \"a\",\r\n isDigit: false\r\n }, {\r\n date: new Date(2009, 8, 1, 6, 5, 4),\r\n pattern: \"d\"\r\n }, {\r\n date: [new Date(2009, 8, 2, 6, 5, 4), new Date(2009, 8, 3, 6, 5, 4), new Date(2009, 8, 4, 6, 5, 4)],\r\n pattern: \"E\"\r\n }, {\r\n date: new Date(2009, 9, 6, 6, 5, 4),\r\n pattern: \"M\"\r\n }, {\r\n date: new Date(1998, 8, 8, 6, 5, 4),\r\n pattern: \"y\"\r\n }];\r\n if (!result) {\r\n return\r\n }\r\n datePatterns.forEach((function(test) {\r\n var diff = getDifference(defaultPattern, formatValue(test.date, formatter), processedIndexes, test.isDigit);\r\n var pattern = \"M\" === test.pattern && !replacedPatterns.d ? \"L\" : test.pattern;\r\n result = replaceChars(result, diff, pattern, patternPositions);\r\n replacedPatterns[pattern] = diff.length\r\n }));\r\n result = escapeChars(result, defaultPattern, processedIndexes, patternPositions);\r\n if (processedIndexes.length) {\r\n return result\r\n }\r\n};\r\n","/**\r\n * DevExtreme (esm/localization/default_date_names.js)\r\n * Version: 22.1.6\r\n * Build date: Tue Oct 18 2022\r\n *\r\n * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED\r\n * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/\r\n */\r\nimport {\r\n map\r\n} from \"../core/utils/iterator\";\r\nvar MONTHS = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\r\nvar DAYS = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\r\nvar PERIODS = [\"AM\", \"PM\"];\r\nvar QUARTERS = [\"Q1\", \"Q2\", \"Q3\", \"Q4\"];\r\nvar cutCaptions = (captions, format) => {\r\n var lengthByFormat = {\r\n abbreviated: 3,\r\n short: 2,\r\n narrow: 1\r\n };\r\n return map(captions, caption => caption.substr(0, lengthByFormat[format]))\r\n};\r\nexport default {\r\n getMonthNames: function(format) {\r\n return cutCaptions(MONTHS, format)\r\n },\r\n getDayNames: function(format) {\r\n return cutCaptions(DAYS, format)\r\n },\r\n getQuarterNames: function(format) {\r\n return QUARTERS\r\n },\r\n getPeriodNames: function(format) {\r\n return PERIODS\r\n }\r\n};\r\n","/** @license\n *\n * jsPDF - PDF Document creation from JavaScript\n * Version 2.5.1 Built on 2022-01-28T15:37:57.791Z\n * CommitID 00000000\n *\n * Copyright (c) 2010-2021 James Hall
, https://github.com/MrRio/jsPDF\n * 2015-2021 yWorks GmbH, http://www.yworks.com\n * 2015-2021 Lukas Holländer , https://github.com/HackbrettXXX\n * 2016-2018 Aras Abbasi \n * 2010 Aaron Spike, https://github.com/acspike\n * 2012 Willow Systems Corporation, https://github.com/willowsystems\n * 2012 Pablo Hess, https://github.com/pablohess\n * 2012 Florian Jenett, https://github.com/fjenett\n * 2013 Warren Weckesser, https://github.com/warrenweckesser\n * 2013 Youssef Beddad, https://github.com/lifof\n * 2013 Lee Driscoll, https://github.com/lsdriscoll\n * 2013 Stefan Slonevskiy, https://github.com/stefslon\n * 2013 Jeremy Morel, https://github.com/jmorel\n * 2013 Christoph Hartmann, https://github.com/chris-rock\n * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria\n * 2014 James Makes, https://github.com/dollaruw\n * 2014 Diego Casorran, https://github.com/diegocr\n * 2014 Steven Spungin, https://github.com/Flamenco\n * 2014 Kenneth Glassey, https://github.com/Gavvers\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * Contributor(s):\n * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,\n * kim3er, mfo, alnorth, Flamenco\n */\n\nimport t from\"@babel/runtime/helpers/typeof\";import{zlibSync as e,unzlibSync as r}from\"fflate\";var n=function(){return\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this}();function i(){n.console&&\"function\"==typeof n.console.log&&n.console.log.apply(n.console,arguments)}var a={log:i,warn:function(t){n.console&&(\"function\"==typeof n.console.warn?n.console.warn.apply(n.console,arguments):i.call(null,arguments))},error:function(t){n.console&&(\"function\"==typeof n.console.error?n.console.error.apply(n.console,arguments):i(t))}};function o(t,e,r){var n=new XMLHttpRequest;n.open(\"GET\",t),n.responseType=\"blob\",n.onload=function(){l(n.response,e,r)},n.onerror=function(){a.error(\"could not download file\")},n.send()}function s(t){var e=new XMLHttpRequest;e.open(\"HEAD\",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function c(t){try{t.dispatchEvent(new MouseEvent(\"click\"))}catch(r){var e=document.createEvent(\"MouseEvents\");e.initMouseEvent(\"click\",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var u,h,l=n.saveAs||(\"object\"!==(\"undefined\"==typeof window?\"undefined\":t(window))||window!==n?function(){}:\"undefined\"!=typeof HTMLAnchorElement&&\"download\"in HTMLAnchorElement.prototype?function(t,e,r){var i=n.URL||n.webkitURL,a=document.createElement(\"a\");e=e||t.name||\"download\",a.download=e,a.rel=\"noopener\",\"string\"==typeof t?(a.href=t,a.origin!==location.origin?s(a.href)?o(t,e,r):c(a,a.target=\"_blank\"):c(a)):(a.href=i.createObjectURL(t),setTimeout((function(){i.revokeObjectURL(a.href)}),4e4),setTimeout((function(){c(a)}),0))}:\"msSaveOrOpenBlob\"in navigator?function(e,r,n){if(r=r||e.name||\"download\",\"string\"==typeof e)if(s(e))o(e,r,n);else{var i=document.createElement(\"a\");i.href=e,i.target=\"_blank\",setTimeout((function(){c(i)}))}else navigator.msSaveOrOpenBlob(function(e,r){return void 0===r?r={autoBom:!1}:\"object\"!==t(r)&&(a.warn(\"Deprecated: Expected third argument to be a object\"),r={autoBom:!r}),r.autoBom&&/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,n),r)}:function(e,r,i,a){if((a=a||open(\"\",\"_blank\"))&&(a.document.title=a.document.body.innerText=\"downloading...\"),\"string\"==typeof e)return o(e,r,i);var s=\"application/octet-stream\"===e.type,c=/constructor/i.test(n.HTMLElement)||n.safari,u=/CriOS\\/[\\d]+/.test(navigator.userAgent);if((u||s&&c)&&\"object\"===(\"undefined\"==typeof FileReader?\"undefined\":t(FileReader))){var h=new FileReader;h.onloadend=function(){var t=h.result;t=u?t:t.replace(/^data:[^;]*;/,\"data:attachment/file;\"),a?a.location.href=t:location=t,a=null},h.readAsDataURL(e)}else{var l=n.URL||n.webkitURL,f=l.createObjectURL(e);a?a.location=f:location.href=f,a=null,setTimeout((function(){l.revokeObjectURL(f)}),4e4)}});\n/**\n * A class to parse color values\n * @author Stoyan Stefanov \n * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}\n * @license Use it if you like it\n */function f(t){var e;t=t||\"\",this.ok=!1,\"#\"==t.charAt(0)&&(t=t.substr(1,6));t={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"00ffff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000000\",blanchedalmond:\"ffebcd\",blue:\"0000ff\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"00ffff\",darkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dodgerblue:\"1e90ff\",feldspar:\"d19275\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"ff00ff\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgrey:\"d3d3d3\",lightgreen:\"90ee90\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",lightslateblue:\"8470ff\",lightslategray:\"778899\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"00ff00\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"ff00ff\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370d8\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"d87093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",red:\"ff0000\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",slategray:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",violetred:\"d02090\",wheat:\"f5deb3\",white:\"ffffff\",whitesmoke:\"f5f5f5\",yellow:\"ffff00\",yellowgreen:\"9acd32\"}[t=(t=t.replace(/ /g,\"\")).toLowerCase()]||t;for(var r=[{re:/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,example:[\"rgb(123, 234, 45)\",\"rgb(255,234,245)\"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\\w{2})(\\w{2})(\\w{2})$/,example:[\"#00ff00\",\"336699\"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\\w{1})(\\w{1})(\\w{1})$/,example:[\"#fb0\",\"f0f\"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],n=0;n255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return\"rgb(\"+this.r+\", \"+this.g+\", \"+this.b+\")\"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),r=this.b.toString(16);return 1==t.length&&(t=\"0\"+t),1==e.length&&(e=\"0\"+e),1==r.length&&(r=\"0\"+r),\"#\"+t+e+r}}\n/**\n * @license\n * Joseph Myers does not specify a particular license for his work.\n *\n * Author: Joseph Myers\n * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js\n *\n * Modified by: Owen Leong\n */\nfunction d(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];r=g(r,n,i,a,e[0],7,-680876936),a=g(a,r,n,i,e[1],12,-389564586),i=g(i,a,r,n,e[2],17,606105819),n=g(n,i,a,r,e[3],22,-1044525330),r=g(r,n,i,a,e[4],7,-176418897),a=g(a,r,n,i,e[5],12,1200080426),i=g(i,a,r,n,e[6],17,-1473231341),n=g(n,i,a,r,e[7],22,-45705983),r=g(r,n,i,a,e[8],7,1770035416),a=g(a,r,n,i,e[9],12,-1958414417),i=g(i,a,r,n,e[10],17,-42063),n=g(n,i,a,r,e[11],22,-1990404162),r=g(r,n,i,a,e[12],7,1804603682),a=g(a,r,n,i,e[13],12,-40341101),i=g(i,a,r,n,e[14],17,-1502002290),r=m(r,n=g(n,i,a,r,e[15],22,1236535329),i,a,e[1],5,-165796510),a=m(a,r,n,i,e[6],9,-1069501632),i=m(i,a,r,n,e[11],14,643717713),n=m(n,i,a,r,e[0],20,-373897302),r=m(r,n,i,a,e[5],5,-701558691),a=m(a,r,n,i,e[10],9,38016083),i=m(i,a,r,n,e[15],14,-660478335),n=m(n,i,a,r,e[4],20,-405537848),r=m(r,n,i,a,e[9],5,568446438),a=m(a,r,n,i,e[14],9,-1019803690),i=m(i,a,r,n,e[3],14,-187363961),n=m(n,i,a,r,e[8],20,1163531501),r=m(r,n,i,a,e[13],5,-1444681467),a=m(a,r,n,i,e[2],9,-51403784),i=m(i,a,r,n,e[7],14,1735328473),r=v(r,n=m(n,i,a,r,e[12],20,-1926607734),i,a,e[5],4,-378558),a=v(a,r,n,i,e[8],11,-2022574463),i=v(i,a,r,n,e[11],16,1839030562),n=v(n,i,a,r,e[14],23,-35309556),r=v(r,n,i,a,e[1],4,-1530992060),a=v(a,r,n,i,e[4],11,1272893353),i=v(i,a,r,n,e[7],16,-155497632),n=v(n,i,a,r,e[10],23,-1094730640),r=v(r,n,i,a,e[13],4,681279174),a=v(a,r,n,i,e[0],11,-358537222),i=v(i,a,r,n,e[3],16,-722521979),n=v(n,i,a,r,e[6],23,76029189),r=v(r,n,i,a,e[9],4,-640364487),a=v(a,r,n,i,e[12],11,-421815835),i=v(i,a,r,n,e[15],16,530742520),r=b(r,n=v(n,i,a,r,e[2],23,-995338651),i,a,e[0],6,-198630844),a=b(a,r,n,i,e[7],10,1126891415),i=b(i,a,r,n,e[14],15,-1416354905),n=b(n,i,a,r,e[5],21,-57434055),r=b(r,n,i,a,e[12],6,1700485571),a=b(a,r,n,i,e[3],10,-1894986606),i=b(i,a,r,n,e[10],15,-1051523),n=b(n,i,a,r,e[1],21,-2054922799),r=b(r,n,i,a,e[8],6,1873313359),a=b(a,r,n,i,e[15],10,-30611744),i=b(i,a,r,n,e[6],15,-1560198380),n=b(n,i,a,r,e[13],21,1309151649),r=b(r,n,i,a,e[4],6,-145523070),a=b(a,r,n,i,e[11],10,-1120210379),i=b(i,a,r,n,e[2],15,718787259),n=b(n,i,a,r,e[9],21,-343485551),t[0]=_(r,t[0]),t[1]=_(n,t[1]),t[2]=_(i,t[2]),t[3]=_(a,t[3])}function p(t,e,r,n,i,a){return e=_(_(e,t),_(n,a)),_(e<>>32-i,r)}function g(t,e,r,n,i,a,o){return p(e&r|~e&n,t,e,i,a,o)}function m(t,e,r,n,i,a,o){return p(e&n|r&~n,t,e,i,a,o)}function v(t,e,r,n,i,a,o){return p(e^r^n,t,e,i,a,o)}function b(t,e,r,n,i,a,o){return p(r^(e|~n),t,e,i,a,o)}function y(t){var e,r=t.length,n=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)d(n,w(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(d(n,i),e=0;e<16;e++)i[e]=0;return i[14]=8*r,d(n,i),n}function w(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}u=n.atob.bind(n),h=n.btoa.bind(n);var N=\"0123456789abcdef\".split(\"\");function L(t){for(var e=\"\",r=0;r<4;r++)e+=N[t>>8*r+4&15]+N[t>>8*r&15];return e}function A(t){return String.fromCharCode((255&t)>>0,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function x(t){return y(t).map(A).join(\"\")}var S=\"5d41402abc4b2a76b9719d911017c592\"!=function(t){for(var e=0;e>16)+(e>>16)+(r>>16)<<16|65535&r}return t+e&4294967295}\n/**\n * @license\n * FPDF is released under a permissive license: there is no usage restriction.\n * You may embed it freely in your application (commercial or not), with or\n * without modifications.\n *\n * Reference: http://www.fpdf.org/en/script/script37.php\n */function P(t,e){var r,n,i,a;if(t!==r){for(var o=(i=t,a=1+(256/t.length>>0),new Array(a+1).join(i)),s=[],c=0;c<256;c++)s[c]=c;var u=0;for(c=0;c<256;c++){var h=s[c];u=(u+h+o.charCodeAt(c))%256,s[c]=s[u],s[u]=h}r=t,n=s}else s=n;var l=e.length,f=0,d=0,p=\"\";for(c=0;c/\\f©þdSiz\";var a=(e+this.padding).substr(0,32),o=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=x(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=P(this.encryptionKey,this.padding)}function F(t){if(/[^\\u0000-\\u00ff]/.test(t))throw new Error(\"Invalid PDF Name Object: \"+t+\", Only accept ASCII characters.\");for(var e=\"\",r=t.length,n=0;n126)e+=\"#\"+(\"0\"+i.toString(16)).slice(-2);else e+=t[n]}return e}function C(e){if(\"object\"!==t(e))throw new Error(\"Invalid Context passed to initialize PubSub (jsPDF-module)\");var r={};this.subscribe=function(t,e,n){if(n=n||!1,\"string\"!=typeof t||\"function\"!=typeof e||\"boolean\"!=typeof n)throw new Error(\"Invalid arguments passed to PubSub.subscribe (jsPDF-module)\");r.hasOwnProperty(t)||(r[t]={});var i=Math.random().toString(35);return r[t][i]=[e,!!n],i},this.unsubscribe=function(t){for(var e in r)if(r[e][t])return delete r[e][t],0===Object.keys(r[e]).length&&delete r[e],!0;return!1},this.publish=function(t){if(r.hasOwnProperty(t)){var i=Array.prototype.slice.call(arguments,1),o=[];for(var s in r[t]){var c=r[t][s];try{c[0].apply(e,i)}catch(t){n.console&&a.error(\"jsPDF PubSub Error\",t.message,t)}c[1]&&o.push(s)}o.length&&o.forEach(this.unsubscribe)}},this.getTopics=function(){return r}}function j(t){if(!(this instanceof j))return new j(t);var e=\"opacity,stroke-opacity\".split(\",\");for(var r in t)t.hasOwnProperty(r)&&e.indexOf(r)>=0&&(this[r]=t[r]);this.id=\"\",this.objectNumber=-1}function O(t,e){this.gState=t,this.matrix=e,this.id=\"\",this.objectNumber=-1}function B(t,e,r,n,i){if(!(this instanceof B))return new B(t,e,r,n,i);this.type=\"axial\"===t?2:3,this.coords=e,this.colors=r,O.call(this,n,i)}function M(t,e,r,n,i){if(!(this instanceof M))return new M(t,e,r,n,i);this.boundingBox=t,this.xStep=e,this.yStep=r,this.stream=\"\",this.cloneIndex=0,O.call(this,n,i)}function E(e){var r,i=\"string\"==typeof arguments[0]?arguments[0]:\"p\",o=arguments[1],s=arguments[2],c=arguments[3],u=[],d=1,p=16,g=\"S\",m=null;\"object\"===t(e=e||{})&&(i=e.orientation,o=e.unit||o,s=e.format||s,c=e.compress||e.compressPdf||c,null!==(m=e.encryption||null)&&(m.userPassword=m.userPassword||\"\",m.ownerPassword=m.ownerPassword||\"\",m.userPermissions=m.userPermissions||[]),d=\"number\"==typeof e.userUnit?Math.abs(e.userUnit):1,void 0!==e.precision&&(r=e.precision),void 0!==e.floatPrecision&&(p=e.floatPrecision),g=e.defaultPathOperation||\"S\"),u=e.filters||(!0===c?[\"FlateEncode\"]:u),o=o||\"mm\",i=(\"\"+(i||\"P\")).toLowerCase();var v=e.putOnlyUsedFonts||!1,b={},y={internal:{},__private__:{}};y.__private__.PubSub=C;var w=\"1.3\",N=y.__private__.getPdfVersion=function(){return w};y.__private__.setPdfVersion=function(t){w=t};var L={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],\"government-letter\":[576,756],legal:[612,1008],\"junior-legal\":[576,360],ledger:[1224,792],tabloid:[792,1224],\"credit-card\":[153,243]};y.__private__.getPageFormats=function(){return L};var A=y.__private__.getPageFormat=function(t){return L[t]};s=s||\"a4\";var x={COMPAT:\"compat\",ADVANCED:\"advanced\"},S=x.COMPAT;function _(){this.saveGraphicsState(),lt(new Vt(_t,0,0,-_t,0,Rr()*_t).toString()+\" cm\"),this.setFontSize(this.getFontSize()/_t),g=\"n\",S=x.ADVANCED}function P(){this.restoreGraphicsState(),g=\"S\",S=x.COMPAT}var k=y.__private__.combineFontStyleAndFontWeight=function(t,e){if(\"bold\"==t&&\"normal\"==e||\"bold\"==t&&400==e||\"normal\"==t&&\"italic\"==e||\"bold\"==t&&\"italic\"==e)throw new Error(\"Invalid Combination of fontweight and fontstyle\");return e&&(t=400==e||\"normal\"===e?\"italic\"===t?\"italic\":\"normal\":700!=e&&\"bold\"!==e||\"normal\"!==t?(700==e?\"bold\":e)+\"\"+t:\"bold\"),t};y.advancedAPI=function(t){var e=S===x.COMPAT;return e&&_.call(this),\"function\"!=typeof t||(t(this),e&&P.call(this)),this},y.compatAPI=function(t){var e=S===x.ADVANCED;return e&&P.call(this),\"function\"!=typeof t||(t(this),e&&_.call(this)),this},y.isAdvancedAPI=function(){return S===x.ADVANCED};var O,q=function(t){if(S!==x.ADVANCED)throw new Error(t+\" is only available in 'advanced' API mode. You need to call advancedAPI() first.\")},D=y.roundToPrecision=y.__private__.roundToPrecision=function(t,e){var n=r||e;if(isNaN(t)||isNaN(n))throw new Error(\"Invalid argument passed to jsPDF.roundToPrecision\");return t.toFixed(n).replace(/0+$/,\"\")};O=y.hpf=y.__private__.hpf=\"number\"==typeof p?function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.hpf\");return D(t,p)}:\"smart\"===p?function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.hpf\");return D(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.hpf\");return D(t,16)};var R=y.f2=y.__private__.f2=function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.f2\");return D(t,2)},T=y.__private__.f3=function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.f3\");return D(t,3)},U=y.scale=y.__private__.scale=function(t){if(isNaN(t))throw new Error(\"Invalid argument passed to jsPDF.scale\");return S===x.COMPAT?t*_t:S===x.ADVANCED?t:void 0},z=function(t){return S===x.COMPAT?Rr()-t:S===x.ADVANCED?t:void 0},H=function(t){return U(z(t))};y.__private__.setPrecision=y.setPrecision=function(t){\"number\"==typeof parseInt(t,10)&&(r=parseInt(t,10))};var W,V=\"00000000000000000000000000000000\",G=y.__private__.getFileId=function(){return V},Y=y.__private__.setFileId=function(t){return V=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():V.split(\"\").map((function(){return\"ABCDEF0123456789\".charAt(Math.floor(16*Math.random()))})).join(\"\"),null!==m&&(Ye=new I(m.userPermissions,m.userPassword,m.ownerPassword,V)),V};y.setFileId=function(t){return Y(t),this},y.getFileId=function(){return G()};var J=y.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),r=e<0?\"+\":\"-\",n=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),a=[r,Q(n),\"'\",Q(i),\"'\"].join(\"\");return[\"D:\",t.getFullYear(),Q(t.getMonth()+1),Q(t.getDate()),Q(t.getHours()),Q(t.getMinutes()),Q(t.getSeconds()),a].join(\"\")},X=y.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),r=parseInt(t.substr(6,2),10)-1,n=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(e,r,n,i,a,o,0)},K=y.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),t instanceof Date)e=J(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\\+0[0-9]|\\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error(\"Invalid argument passed to jsPDF.setCreationDate\");e=t}return W=e},Z=y.__private__.getCreationDate=function(t){var e=W;return\"jsDate\"===t&&(e=X(W)),e};y.setCreationDate=function(t){return K(t),this},y.getCreationDate=function(t){return Z(t)};var $,Q=y.__private__.padd2=function(t){return(\"0\"+parseInt(t)).slice(-2)},tt=y.__private__.padd2Hex=function(t){return(\"00\"+(t=t.toString())).substr(t.length)},et=0,rt=[],nt=[],it=0,at=[],ot=[],st=!1,ct=nt,ut=function(){et=0,it=0,nt=[],rt=[],at=[],Qt=Kt(),te=Kt()};y.__private__.setCustomOutputDestination=function(t){st=!0,ct=t};var ht=function(t){st||(ct=t)};y.__private__.resetCustomOutputDestination=function(){st=!1,ct=nt};var lt=y.__private__.out=function(t){return t=t.toString(),it+=t.length+1,ct.push(t),ct},ft=y.__private__.write=function(t){return lt(1===arguments.length?t.toString():Array.prototype.join.call(arguments,\" \"))},dt=y.__private__.getArrayBuffer=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r);e--;)n[e]=t.charCodeAt(e);return r},pt=[[\"Helvetica\",\"helvetica\",\"normal\",\"WinAnsiEncoding\"],[\"Helvetica-Bold\",\"helvetica\",\"bold\",\"WinAnsiEncoding\"],[\"Helvetica-Oblique\",\"helvetica\",\"italic\",\"WinAnsiEncoding\"],[\"Helvetica-BoldOblique\",\"helvetica\",\"bolditalic\",\"WinAnsiEncoding\"],[\"Courier\",\"courier\",\"normal\",\"WinAnsiEncoding\"],[\"Courier-Bold\",\"courier\",\"bold\",\"WinAnsiEncoding\"],[\"Courier-Oblique\",\"courier\",\"italic\",\"WinAnsiEncoding\"],[\"Courier-BoldOblique\",\"courier\",\"bolditalic\",\"WinAnsiEncoding\"],[\"Times-Roman\",\"times\",\"normal\",\"WinAnsiEncoding\"],[\"Times-Bold\",\"times\",\"bold\",\"WinAnsiEncoding\"],[\"Times-Italic\",\"times\",\"italic\",\"WinAnsiEncoding\"],[\"Times-BoldItalic\",\"times\",\"bolditalic\",\"WinAnsiEncoding\"],[\"ZapfDingbats\",\"zapfdingbats\",\"normal\",null],[\"Symbol\",\"symbol\",\"normal\",null]];y.__private__.getStandardFonts=function(){return pt};var gt=e.fontSize||16;y.__private__.setFontSize=y.setFontSize=function(t){return gt=S===x.ADVANCED?t/_t:t,this};var mt,vt=y.__private__.getFontSize=y.getFontSize=function(){return S===x.COMPAT?gt:gt*_t},bt=e.R2L||!1;y.__private__.setR2L=y.setR2L=function(t){return bt=t,this},y.__private__.getR2L=y.getR2L=function(){return bt};var yt,wt=y.__private__.setZoomMode=function(t){var e=[void 0,null,\"fullwidth\",\"fullheight\",\"fullpage\",\"original\"];if(/^(?:\\d+\\.\\d*|\\d*\\.\\d+|\\d+)%$/.test(t))mt=t;else if(isNaN(t)){if(-1===e.indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. \"'+t+'\" is not recognized.');mt=t}else mt=parseInt(t,10)};y.__private__.getZoomMode=function(){return mt};var Nt,Lt=y.__private__.setPageMode=function(t){if(-1==[void 0,null,\"UseNone\",\"UseOutlines\",\"UseThumbs\",\"FullScreen\"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. \"'+t+'\" is not recognized.');yt=t};y.__private__.getPageMode=function(){return yt};var At=y.__private__.setLayoutMode=function(t){if(-1==[void 0,null,\"continuous\",\"single\",\"twoleft\",\"tworight\",\"two\"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. \"'+t+'\" is not recognized.');Nt=t};y.__private__.getLayoutMode=function(){return Nt},y.__private__.setDisplayMode=y.setDisplayMode=function(t,e,r){return wt(t),At(e),Lt(r),this};var xt={title:\"\",subject:\"\",author:\"\",keywords:\"\",creator:\"\"};y.__private__.getDocumentProperty=function(t){if(-1===Object.keys(xt).indexOf(t))throw new Error(\"Invalid argument passed to jsPDF.getDocumentProperty\");return xt[t]},y.__private__.getDocumentProperties=function(){return xt},y.__private__.setDocumentProperties=y.setProperties=y.setDocumentProperties=function(t){for(var e in xt)xt.hasOwnProperty(e)&&t[e]&&(xt[e]=t[e]);return this},y.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(xt).indexOf(t))throw new Error(\"Invalid arguments passed to jsPDF.setDocumentProperty\");return xt[t]=e};var St,_t,Pt,kt,It,Ft={},Ct={},jt=[],Ot={},Bt={},Mt={},Et={},qt=null,Dt=0,Rt=[],Tt=new C(y),Ut=e.hotfixes||[],zt={},Ht={},Wt=[],Vt=function t(e,r,n,i,a,o){if(!(this instanceof t))return new t(e,r,n,i,a,o);isNaN(e)&&(e=1),isNaN(r)&&(r=0),isNaN(n)&&(n=0),isNaN(i)&&(i=1),isNaN(a)&&(a=0),isNaN(o)&&(o=0),this._matrix=[e,r,n,i,a,o]};Object.defineProperty(Vt.prototype,\"sx\",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Vt.prototype,\"shy\",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Vt.prototype,\"shx\",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Vt.prototype,\"sy\",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Vt.prototype,\"tx\",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Vt.prototype,\"ty\",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Vt.prototype,\"a\",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Vt.prototype,\"b\",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Vt.prototype,\"c\",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Vt.prototype,\"d\",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Vt.prototype,\"e\",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Vt.prototype,\"f\",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Vt.prototype,\"rotation\",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Vt.prototype,\"scaleX\",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Vt.prototype,\"scaleY\",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Vt.prototype,\"isIdentity\",{get:function(){return 1===this.sx&&(0===this.shy&&(0===this.shx&&(1===this.sy&&(0===this.tx&&0===this.ty))))}}),Vt.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(O).join(t)},Vt.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,r=t.sx*this.shy+t.shy*this.sy,n=t.shx*this.sx+t.sy*this.shx,i=t.shx*this.shy+t.sy*this.sy,a=t.tx*this.sx+t.ty*this.shx+this.tx,o=t.tx*this.shy+t.ty*this.sy+this.ty;return new Vt(e,r,n,i,a,o)},Vt.prototype.decompose=function(){var t=this.sx,e=this.shy,r=this.shx,n=this.sy,i=this.tx,a=this.ty,o=Math.sqrt(t*t+e*e),s=(t/=o)*r+(e/=o)*n;r-=t*s,n-=e*s;var c=Math.sqrt(r*r+n*n);return s/=c,t*(n/=c)>16&255,i=u>>8&255,a=255&u}if(void 0===i||void 0===o&&n===i&&i===a)if(\"string\"==typeof n)r=n+\" \"+s[0];else switch(e.precision){case 2:r=R(n/255)+\" \"+s[0];break;case 3:default:r=T(n/255)+\" \"+s[0]}else if(void 0===o||\"object\"===t(o)){if(o&&!isNaN(o.a)&&0===o.a)return r=[\"1.\",\"1.\",\"1.\",s[1]].join(\" \");if(\"string\"==typeof n)r=[n,i,a,s[1]].join(\" \");else switch(e.precision){case 2:r=[R(n/255),R(i/255),R(a/255),s[1]].join(\" \");break;default:case 3:r=[T(n/255),T(i/255),T(a/255),s[1]].join(\" \")}}else if(\"string\"==typeof n)r=[n,i,a,o,s[2]].join(\" \");else switch(e.precision){case 2:r=[R(n),R(i),R(a),R(o),s[2]].join(\" \");break;case 3:default:r=[T(n),T(i),T(a),T(o),s[2]].join(\" \")}return r},ne=y.__private__.getFilters=function(){return u},ie=y.__private__.putStream=function(t){var e=(t=t||{}).data||\"\",r=t.filters||ne(),n=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,o=t.objectId,s=function(t){return t};if(null!==m&&void 0===o)throw new Error(\"ObjectId must be passed to putStream for file encryption\");null!==m&&(s=Ye.encryptor(o,0));var c={};!0===r&&(r=[\"FlateEncode\"]);var u=t.additionalKeyValues||[],h=(c=void 0!==E.API.processDataByFilters?E.API.processDataByFilters(e,r):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(n)?n.join(\" \"):n.toString());if(0!==c.data.length&&(u.push({key:\"Length\",value:c.data.length}),!0===i&&u.push({key:\"Length1\",value:a})),0!=h.length)if(h.split(\"/\").length-1==1)u.push({key:\"Filter\",value:h});else{u.push({key:\"Filter\",value:\"[\"+h+\"]\"});for(var l=0;l>\"),0!==c.data.length&&(lt(\"stream\"),lt(s(c.data)),lt(\"endstream\"))},ae=y.__private__.putPage=function(t){var e=t.number,r=t.data,n=t.objId,i=t.contentsObjId;Zt(n,!0),lt(\"<>\"),lt(\"endobj\");var a=r.join(\"\\n\");return S===x.ADVANCED&&(a+=\"\\nQ\"),Zt(i,!0),ie({data:a,filters:ne(),objectId:i}),lt(\"endobj\"),n},oe=y.__private__.putPages=function(){var t,e,r=[];for(t=1;t<=Dt;t++)Rt[t].objId=Kt(),Rt[t].contentsObjId=Kt();for(t=1;t<=Dt;t++)r.push(ae({number:t,data:ot[t],objId:Rt[t].objId,contentsObjId:Rt[t].contentsObjId,mediaBox:Rt[t].mediaBox,cropBox:Rt[t].cropBox,bleedBox:Rt[t].bleedBox,trimBox:Rt[t].trimBox,artBox:Rt[t].artBox,userUnit:Rt[t].userUnit,rootDictionaryObjId:Qt,resourceDictionaryObjId:te}));Zt(Qt,!0),lt(\"<>\"),lt(\"endobj\"),Tt.publish(\"postPutPages\")},se=function(t){Tt.publish(\"putFont\",{font:t,out:lt,newObject:Xt,putStream:ie}),!0!==t.isAlreadyPutted&&(t.objectNumber=Xt(),lt(\"<<\"),lt(\"/Type /Font\"),lt(\"/BaseFont /\"+F(t.postScriptName)),lt(\"/Subtype /Type1\"),\"string\"==typeof t.encoding&<(\"/Encoding /\"+t.encoding),lt(\"/FirstChar 32\"),lt(\"/LastChar 255\"),lt(\">>\"),lt(\"endobj\"))},ce=function(){for(var t in Ft)Ft.hasOwnProperty(t)&&(!1===v||!0===v&&b.hasOwnProperty(t))&&se(Ft[t])},ue=function(t){t.objectNumber=Xt();var e=[];e.push({key:\"Type\",value:\"/XObject\"}),e.push({key:\"Subtype\",value:\"/Form\"}),e.push({key:\"BBox\",value:\"[\"+[O(t.x),O(t.y),O(t.x+t.width),O(t.y+t.height)].join(\" \")+\"]\"}),e.push({key:\"Matrix\",value:\"[\"+t.matrix.toString()+\"]\"});var r=t.pages[1].join(\"\\n\");ie({data:r,additionalKeyValues:e,objectId:t.objectNumber}),lt(\"endobj\")},he=function(){for(var t in zt)zt.hasOwnProperty(t)&&ue(zt[t])},le=function(t,e){var r,n=[],i=1/(e-1);for(r=0;r<1;r+=i)n.push(r);if(n.push(1),0!=t[0].offset){var a={offset:0,color:t[0].color};t.unshift(a)}if(1!=t[t.length-1].offset){var o={offset:1,color:t[t.length-1].color};t.push(o)}for(var s=\"\",c=0,u=0;ut[c+1].offset;)c++;var h=t[c].offset,l=(r-h)/(t[c+1].offset-h),f=t[c].color,d=t[c+1].color;s+=tt(Math.round((1-l)*f[0]+l*d[0]).toString(16))+tt(Math.round((1-l)*f[1]+l*d[1]).toString(16))+tt(Math.round((1-l)*f[2]+l*d[2]).toString(16))}return s.trim()},fe=function(t,e){e||(e=21);var r=Xt(),n=le(t.colors,e),i=[];i.push({key:\"FunctionType\",value:\"0\"}),i.push({key:\"Domain\",value:\"[0.0 1.0]\"}),i.push({key:\"Size\",value:\"[\"+e+\"]\"}),i.push({key:\"BitsPerSample\",value:\"8\"}),i.push({key:\"Range\",value:\"[0.0 1.0 0.0 1.0 0.0 1.0]\"}),i.push({key:\"Decode\",value:\"[0.0 1.0 0.0 1.0 0.0 1.0]\"}),ie({data:n,additionalKeyValues:i,alreadyAppliedFilters:[\"/ASCIIHexDecode\"],objectId:r}),lt(\"endobj\"),t.objectNumber=Xt(),lt(\"<< /ShadingType \"+t.type),lt(\"/ColorSpace /DeviceRGB\");var a=\"/Coords [\"+O(parseFloat(t.coords[0]))+\" \"+O(parseFloat(t.coords[1]))+\" \";2===t.type?a+=O(parseFloat(t.coords[2]))+\" \"+O(parseFloat(t.coords[3])):a+=O(parseFloat(t.coords[2]))+\" \"+O(parseFloat(t.coords[3]))+\" \"+O(parseFloat(t.coords[4]))+\" \"+O(parseFloat(t.coords[5])),lt(a+=\"]\"),t.matrix&<(\"/Matrix [\"+t.matrix.toString()+\"]\"),lt(\"/Function \"+r+\" 0 R\"),lt(\"/Extend [true true]\"),lt(\">>\"),lt(\"endobj\")},de=function(t,e){var r=Kt(),n=Xt();e.push({resourcesOid:r,objectOid:n}),t.objectNumber=n;var i=[];i.push({key:\"Type\",value:\"/Pattern\"}),i.push({key:\"PatternType\",value:\"1\"}),i.push({key:\"PaintType\",value:\"1\"}),i.push({key:\"TilingType\",value:\"1\"}),i.push({key:\"BBox\",value:\"[\"+t.boundingBox.map(O).join(\" \")+\"]\"}),i.push({key:\"XStep\",value:O(t.xStep)}),i.push({key:\"YStep\",value:O(t.yStep)}),i.push({key:\"Resources\",value:r+\" 0 R\"}),t.matrix&&i.push({key:\"Matrix\",value:\"[\"+t.matrix.toString()+\"]\"}),ie({data:t.stream,additionalKeyValues:i,objectId:t.objectNumber}),lt(\"endobj\")},pe=function(t){var e;for(e in Ot)Ot.hasOwnProperty(e)&&(Ot[e]instanceof B?fe(Ot[e]):Ot[e]instanceof M&&de(Ot[e],t))},ge=function(t){for(var e in t.objectNumber=Xt(),lt(\"<<\"),t)switch(e){case\"opacity\":lt(\"/ca \"+R(t[e]));break;case\"stroke-opacity\":lt(\"/CA \"+R(t[e]))}lt(\">>\"),lt(\"endobj\")},me=function(){var t;for(t in Mt)Mt.hasOwnProperty(t)&&ge(Mt[t])},ve=function(){for(var t in lt(\"/XObject <<\"),zt)zt.hasOwnProperty(t)&&zt[t].objectNumber>=0&<(\"/\"+t+\" \"+zt[t].objectNumber+\" 0 R\");Tt.publish(\"putXobjectDict\"),lt(\">>\")},be=function(){Ye.oid=Xt(),lt(\"<<\"),lt(\"/Filter /Standard\"),lt(\"/V \"+Ye.v),lt(\"/R \"+Ye.r),lt(\"/U <\"+Ye.toHexString(Ye.U)+\">\"),lt(\"/O <\"+Ye.toHexString(Ye.O)+\">\"),lt(\"/P \"+Ye.P),lt(\">>\"),lt(\"endobj\")},ye=function(){for(var t in lt(\"/Font <<\"),Ft)Ft.hasOwnProperty(t)&&(!1===v||!0===v&&b.hasOwnProperty(t))&<(\"/\"+t+\" \"+Ft[t].objectNumber+\" 0 R\");lt(\">>\")},we=function(){if(Object.keys(Ot).length>0){for(var t in lt(\"/Shading <<\"),Ot)Ot.hasOwnProperty(t)&&Ot[t]instanceof B&&Ot[t].objectNumber>=0&<(\"/\"+t+\" \"+Ot[t].objectNumber+\" 0 R\");Tt.publish(\"putShadingPatternDict\"),lt(\">>\")}},Ne=function(t){if(Object.keys(Ot).length>0){for(var e in lt(\"/Pattern <<\"),Ot)Ot.hasOwnProperty(e)&&Ot[e]instanceof y.TilingPattern&&Ot[e].objectNumber>=0&&Ot[e].objectNumber>\")}},Le=function(){if(Object.keys(Mt).length>0){var t;for(t in lt(\"/ExtGState <<\"),Mt)Mt.hasOwnProperty(t)&&Mt[t].objectNumber>=0&<(\"/\"+t+\" \"+Mt[t].objectNumber+\" 0 R\");Tt.publish(\"putGStateDict\"),lt(\">>\")}},Ae=function(t){Zt(t.resourcesOid,!0),lt(\"<<\"),lt(\"/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\"),ye(),we(),Ne(t.objectOid),Le(),ve(),lt(\">>\"),lt(\"endobj\")},xe=function(){var t=[];ce(),me(),he(),pe(t),Tt.publish(\"putResources\"),t.forEach(Ae),Ae({resourcesOid:te,objectOid:Number.MAX_SAFE_INTEGER}),Tt.publish(\"postPutResources\")},Se=function(){Tt.publish(\"putAdditionalObjects\");for(var t=0;t>8&&(c=!0);t=s.join(\"\")}for(r=t.length;void 0===c&&0!==r;)t.charCodeAt(r-1)>>8&&(c=!0),r--;if(!c)return t;for(s=e.noBOM?[]:[254,255],r=0,n=t.length;r>8)>>8)throw new Error(\"Character at position \"+r+\" of string '\"+t+\"' exceeds 16bits. Cannot be encoded into UCS-2 BE\");s.push(h),s.push(u-(h<<8))}return String.fromCharCode.apply(void 0,s)},Ce=y.__private__.pdfEscape=y.pdfEscape=function(t,e){return Fe(t,e).replace(/\\\\/g,\"\\\\\\\\\").replace(/\\(/g,\"\\\\(\").replace(/\\)/g,\"\\\\)\")},je=y.__private__.beginPage=function(t){ot[++Dt]=[],Rt[Dt]={objId:0,contentsObjId:0,userUnit:Number(d),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},Me(Dt),ht(ot[$])},Oe=function(t,e){var r,n,o;switch(i=e||i,\"string\"==typeof t&&(r=A(t.toLowerCase()),Array.isArray(r)&&(n=r[0],o=r[1])),Array.isArray(t)&&(n=t[0]*_t,o=t[1]*_t),isNaN(n)&&(n=s[0],o=s[1]),(n>14400||o>14400)&&(a.warn(\"A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400\"),n=Math.min(14400,n),o=Math.min(14400,o)),s=[n,o],i.substr(0,1)){case\"l\":o>n&&(s=[o,n]);break;case\"p\":n>o&&(s=[o,n])}je(s),pr(fr),lt(Lr),0!==kr&<(kr+\" J\"),0!==Ir&<(Ir+\" j\"),Tt.publish(\"addPage\",{pageNumber:Dt})},Be=function(t){t>0&&t<=Dt&&(ot.splice(t,1),Rt.splice(t,1),Dt--,$>Dt&&($=Dt),this.setPage($))},Me=function(t){t>0&&t<=Dt&&($=t)},Ee=y.__private__.getNumberOfPages=y.getNumberOfPages=function(){return ot.length-1},qe=function(t,e,r){var n,i=void 0;return r=r||{},t=void 0!==t?t:Ft[St].fontName,e=void 0!==e?e:Ft[St].fontStyle,n=t.toLowerCase(),void 0!==Ct[n]&&void 0!==Ct[n][e]?i=Ct[n][e]:void 0!==Ct[t]&&void 0!==Ct[t][e]?i=Ct[t][e]:!1===r.disableWarning&&a.warn(\"Unable to look up font label for font '\"+t+\"', '\"+e+\"'. Refer to getFontList() for available fonts.\"),i||r.noFallback||null==(i=Ct.times[e])&&(i=Ct.times.normal),i},De=y.__private__.putInfo=function(){var t=Xt(),e=function(t){return t};for(var r in null!==m&&(e=Ye.encryptor(t,0)),lt(\"<<\"),lt(\"/Producer (\"+Ce(e(\"jsPDF \"+E.version))+\")\"),xt)xt.hasOwnProperty(r)&&xt[r]&<(\"/\"+r.substr(0,1).toUpperCase()+r.substr(1)+\" (\"+Ce(e(xt[r]))+\")\");lt(\"/CreationDate (\"+Ce(e(W))+\")\"),lt(\">>\"),lt(\"endobj\")},Re=y.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Qt;switch(Xt(),lt(\"<<\"),lt(\"/Type /Catalog\"),lt(\"/Pages \"+e+\" 0 R\"),mt||(mt=\"fullwidth\"),mt){case\"fullwidth\":lt(\"/OpenAction [3 0 R /FitH null]\");break;case\"fullheight\":lt(\"/OpenAction [3 0 R /FitV null]\");break;case\"fullpage\":lt(\"/OpenAction [3 0 R /Fit]\");break;case\"original\":lt(\"/OpenAction [3 0 R /XYZ null null 1]\");break;default:var r=\"\"+mt;\"%\"===r.substr(r.length-1)&&(mt=parseInt(mt)/100),\"number\"==typeof mt&<(\"/OpenAction [3 0 R /XYZ null null \"+R(mt)+\"]\")}switch(Nt||(Nt=\"continuous\"),Nt){case\"continuous\":lt(\"/PageLayout /OneColumn\");break;case\"single\":lt(\"/PageLayout /SinglePage\");break;case\"two\":case\"twoleft\":lt(\"/PageLayout /TwoColumnLeft\");break;case\"tworight\":lt(\"/PageLayout /TwoColumnRight\")}yt&<(\"/PageMode /\"+yt),Tt.publish(\"putCatalog\"),lt(\">>\"),lt(\"endobj\")},Te=y.__private__.putTrailer=function(){lt(\"trailer\"),lt(\"<<\"),lt(\"/Size \"+(et+1)),lt(\"/Root \"+et+\" 0 R\"),lt(\"/Info \"+(et-1)+\" 0 R\"),null!==m&<(\"/Encrypt \"+Ye.oid+\" 0 R\"),lt(\"/ID [ <\"+V+\"> <\"+V+\"> ]\"),lt(\">>\")},Ue=y.__private__.putHeader=function(){lt(\"%PDF-\"+w),lt(\"%ºß¬à\")},ze=y.__private__.putXRef=function(){var t=\"0000000000\";lt(\"xref\"),lt(\"0 \"+(et+1)),lt(\"0000000000 65535 f \");for(var e=1;e<=et;e++){\"function\"==typeof rt[e]?lt((t+rt[e]()).slice(-10)+\" 00000 n \"):void 0!==rt[e]?lt((t+rt[e]).slice(-10)+\" 00000 n \"):lt(\"0000000000 00000 n \")}},He=y.__private__.buildDocument=function(){ut(),ht(nt),Tt.publish(\"buildDocument\"),Ue(),oe(),Se(),xe(),null!==m&&be(),De(),Re();var t=it;return ze(),Te(),lt(\"startxref\"),lt(\"\"+t),lt(\"%%EOF\"),ht(ot[$]),nt.join(\"\\n\")},We=y.__private__.getBlob=function(t){return new Blob([dt(t)],{type:\"application/pdf\"})},Ve=y.output=y.__private__.output=Ie((function(t,e){switch(\"string\"==typeof(e=e||{})?e={filename:e}:e.filename=e.filename||\"generated.pdf\",t){case void 0:return He();case\"save\":y.save(e.filename);break;case\"arraybuffer\":return dt(He());case\"blob\":return We(He());case\"bloburi\":case\"bloburl\":if(void 0!==n.URL&&\"function\"==typeof n.URL.createObjectURL)return n.URL&&n.URL.createObjectURL(We(He()))||void 0;a.warn(\"bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.\");break;case\"datauristring\":case\"dataurlstring\":var r=\"\",i=He();try{r=h(i)}catch(t){r=h(unescape(encodeURIComponent(i)))}return\"data:application/pdf;filename=\"+e.filename+\";base64,\"+r;case\"pdfobjectnewwindow\":if(\"[object Window]\"===Object.prototype.toString.call(n)){var o=\"https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js\",s=' integrity=\"sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==\" crossorigin=\"anonymous\"';e.pdfObjectUrl&&(o=e.pdfObjectUrl,s=\"\");var c='