jspdf-autotable
Advanced tools
Comparing version 3.4.4 to 3.4.5
// Generated by dts-bundle-generator v4.3.0 | ||
export declare type HookHandler = (data: HookData) => void | boolean; | ||
export declare type CellHookHandler = (data: CellHookData) => void | boolean; | ||
export declare type jsPDFConstructor = any; | ||
export declare type jsPDFDocument = any; | ||
export declare type Opts = { | ||
[key: string]: string | number; | ||
}; | ||
declare class DocHandler { | ||
private readonly jsPDFDocument; | ||
readonly userStyles: Partial<Styles>; | ||
constructor(jsPDFDocument: jsPDFDocument); | ||
static setDefaults(defaults: UserOptions, doc?: jsPDFDocument | null): void; | ||
private static unifyColor; | ||
applyStyles(styles: Partial<Styles>, fontOnly?: boolean): void; | ||
splitTextToSize(text: string | string[], size: number, opts: Opts): string[]; | ||
rect(x: number, y: number, width: number, height: number, fillStyle: string): any; | ||
getPreviousAutoTable(): Table; | ||
getTextWidth(text: string | string[]): number; | ||
getDocument(): any; | ||
setPage(page: number): void; | ||
addPage(): any; | ||
getFontList(): { | ||
[key: string]: string[]; | ||
}; | ||
getGlobalOptions(): UserOptions; | ||
getDocumentOptions(): UserOptions; | ||
pageSize(): { | ||
width: number; | ||
height: number; | ||
}; | ||
scaleFactor(): number; | ||
pageNumber(): number; | ||
} | ||
declare class HookData { | ||
table: Table; | ||
pageNumber: number; | ||
pageCount: number; | ||
settings: Settings; | ||
doc: jsPDFDocument; | ||
cursor: { | ||
x: number; | ||
y: number; | ||
}; | ||
constructor(table: Table, doc: DocHandler); | ||
} | ||
declare class CellHookData extends HookData { | ||
cell: Cell; | ||
row: Row; | ||
column: Column; | ||
section: 'head' | 'body' | 'foot'; | ||
constructor(table: Table, doc: DocHandler, cell: Cell, row: Row, column: Column); | ||
} | ||
export declare type MarginPadding = { | ||
top: number; | ||
right: number; | ||
bottom: number; | ||
left: number; | ||
}; | ||
export declare type PageHook = (data: HookData) => void | boolean; | ||
export declare type CellHook = (data: CellHookData) => void | boolean; | ||
export interface HookProps { | ||
didParseCell: CellHook[]; | ||
willDrawCell: CellHook[]; | ||
didDrawCell: CellHook[]; | ||
didDrawPage: PageHook[]; | ||
} | ||
export interface Settings { | ||
includeHiddenHtml: boolean; | ||
useCss: boolean; | ||
theme: 'striped' | 'grid' | 'plain'; | ||
startY: number; | ||
margin: MarginPadding; | ||
pageBreak: 'auto' | 'avoid' | 'always'; | ||
rowPageBreak: 'auto' | 'avoid'; | ||
tableWidth: 'auto' | 'wrap' | number; | ||
showHead: 'everyPage' | 'firstPage' | 'never'; | ||
showFoot: 'everyPage' | 'lastPage' | 'never'; | ||
tableLineWidth: number; | ||
tableLineColor: Color; | ||
} | ||
export interface StylesProps { | ||
styles: Partial<Styles>; | ||
headStyles: Partial<Styles>; | ||
bodyStyles: Partial<Styles>; | ||
footStyles: Partial<Styles>; | ||
alternateRowStyles: Partial<Styles>; | ||
columnStyles: { | ||
[key: string]: Partial<Styles>; | ||
}; | ||
} | ||
declare class Table { | ||
id?: any; | ||
id?: string | number; | ||
cursor: { | ||
@@ -11,5 +97,4 @@ x: number; | ||
}; | ||
doc: any; | ||
userStyles: any; | ||
settings: any; | ||
settings: Settings; | ||
styles: StylesProps; | ||
columns: Column[]; | ||
@@ -31,11 +116,16 @@ head: Row[]; | ||
finalY: number; | ||
styles: any; | ||
cellHooks: any; | ||
hooks: HookProps; | ||
constructor(id: string | number | undefined, settings: Settings, styles: StylesProps, hooks: HookProps, content: { | ||
body: Row[]; | ||
head: Row[]; | ||
foot: Row[]; | ||
columns: Column[]; | ||
}); | ||
allRows(): Row[]; | ||
callCellHooks(handlers: HookHandler[] | CellHookHandler[], cell: Cell, row: Row, column: Column): boolean; | ||
callEndPageHooks(): void; | ||
margin(side: string): any; | ||
callCellHooks(doc: DocHandler, handlers: CellHook[], cell: Cell, row: Row, column: Column): boolean; | ||
callEndPageHooks(doc: DocHandler): void; | ||
} | ||
declare class Row { | ||
raw: HTMLTableRowElement | any; | ||
raw: HTMLTableRowElement | RowInput; | ||
element?: HTMLTableRowElement; | ||
index: number; | ||
@@ -51,12 +141,12 @@ cells: { | ||
spansMultiplePages: boolean; | ||
constructor(raw: any, index: number, section: Section); | ||
hasRowSpan(): boolean; | ||
constructor(raw: RowInput | HTMLTableRowElement, index: number, section: Section); | ||
hasRowSpan(columns: Column[]): boolean; | ||
canEntireRowFit(height: number): boolean; | ||
getMinimumRowHeight(): any; | ||
getMinimumRowHeight(columns: Column[], doc: DocHandler): number; | ||
} | ||
export declare type Section = 'head' | 'body' | 'foot'; | ||
declare class Cell { | ||
raw: HTMLTableCellElement | any; | ||
styles: any; | ||
text: string | string[]; | ||
raw: HTMLTableCellElement | CellInput; | ||
styles: Styles; | ||
text: string[]; | ||
section: Section; | ||
@@ -78,8 +168,8 @@ contentHeight: number; | ||
rowSpan: number; | ||
constructor(raw: any, themeStyles: any, section: Section); | ||
getContentHeight(): any; | ||
padding(name: 'vertical' | 'horizontal' | 'top' | 'bottom' | 'left' | 'right'): any; | ||
constructor(raw: CellInput, styles: Styles, section: Section); | ||
getContentHeight(doc: DocHandler): number; | ||
padding(name: 'vertical' | 'horizontal' | 'top' | 'bottom' | 'left' | 'right'): number; | ||
} | ||
declare class Column { | ||
raw: any; | ||
raw: ColumnOption | null; | ||
dataKey: string | number; | ||
@@ -91,78 +181,40 @@ index: number; | ||
width: number; | ||
constructor(dataKey: string | number, raw: any, index: number); | ||
getMaxCustomCellWidth(): number; | ||
constructor(dataKey: string | number, raw: ColumnOption | null, index: number); | ||
getMaxCustomCellWidth(table: Table): number; | ||
} | ||
declare class HookData { | ||
table: Table; | ||
pageNumber: number; | ||
pageCount: number; | ||
settings: any; | ||
doc: any; | ||
cursor: { | ||
x: number; | ||
y: number; | ||
}; | ||
constructor(); | ||
} | ||
declare class CellHookData extends HookData { | ||
cell: Cell; | ||
row: Row; | ||
column: Column; | ||
section: 'head' | 'body' | 'foot'; | ||
constructor(cell: Cell, row: Row, column: Column); | ||
} | ||
export interface ColumnOption { | ||
header?: string; | ||
title?: string; | ||
footer?: string; | ||
dataKey?: string | number; | ||
} | ||
export declare type UserOptions = HTMLConfig | ContentConfig | ColumnDataConfig; | ||
export declare type Color = [number, number, number] | number | 'transparent' | false; | ||
export declare type MarginPadding = number | { | ||
top?: number; | ||
right?: number; | ||
bottom?: number; | ||
left?: number; | ||
}; | ||
export interface Styles { | ||
font?: 'helvetica' | 'times' | 'courier' | string; | ||
fontStyle?: 'normal' | 'bold' | 'italic' | 'bolditalic'; | ||
overflow?: 'linebreak' | 'ellipsize' | 'visible' | 'hidden'; | ||
fillColor?: Color; | ||
textColor?: Color; | ||
halign?: 'left' | 'center' | 'right' | 'justify'; | ||
valign?: 'top' | 'middle' | 'bottom'; | ||
fontSize?: number; | ||
cellPadding?: number; | ||
lineColor?: Color; | ||
lineWidth?: number; | ||
cellWidth?: 'auto' | 'wrap' | number; | ||
minCellHeight?: number; | ||
font: 'helvetica' | 'times' | 'courier' | string; | ||
fontStyle: 'normal' | 'bold' | 'italic' | 'bolditalic'; | ||
overflow: 'linebreak' | 'ellipsize' | 'visible' | 'hidden' | Function; | ||
fillColor: Color; | ||
textColor: Color; | ||
halign: 'left' | 'center' | 'right' | 'justify'; | ||
valign: 'top' | 'middle' | 'bottom'; | ||
fontSize: number; | ||
cellPadding: MarginPaddingInput; | ||
lineColor: Color; | ||
lineWidth: number; | ||
cellWidth: 'auto' | 'wrap' | number; | ||
minCellHeight: number; | ||
minCellWidth: number; | ||
} | ||
export interface CellDefinition { | ||
rowSpan?: number; | ||
colSpan?: number; | ||
styles?: Styles; | ||
content?: string | string[] | number; | ||
} | ||
export declare type CellType = null | string | number | boolean | CellDefinition; | ||
export declare type MultipleRowType = CellType[][] | { | ||
string: CellType; | ||
}[]; | ||
export declare type SingleRowType = CellType[] | { | ||
string: CellType; | ||
}; | ||
export interface BaseConfig { | ||
theme?: 'striped' | 'grid' | 'plain'; | ||
startY?: number; | ||
margin?: MarginPadding; | ||
export interface UserOptions { | ||
includeHiddenHtml?: boolean; | ||
useCss?: boolean; | ||
theme?: 'striped' | 'grid' | 'plain' | null; | ||
startY?: number | false; | ||
margin?: MarginPaddingInput; | ||
pageBreak?: 'auto' | 'avoid' | 'always'; | ||
rowPageBreak?: 'auto' | 'avoid'; | ||
tableWidth?: 'auto' | 'wrap' | number; | ||
showHead?: 'everyPage' | 'firstPage' | 'never'; | ||
showFoot?: 'everyPage' | 'lastPage' | 'never'; | ||
showHead?: 'everyPage' | 'firstPage' | 'never' | boolean; | ||
showFoot?: 'everyPage' | 'lastPage' | 'never' | boolean; | ||
tableLineWidth?: number; | ||
tableLineColor?: Color; | ||
tableId?: any; | ||
tableId?: string | number; | ||
head?: RowInput[]; | ||
body?: RowInput[]; | ||
foot?: RowInput[]; | ||
html?: string | HTMLTableElement; | ||
columns?: ColumnOption[]; | ||
styles?: Styles; | ||
@@ -176,22 +228,42 @@ bodyStyles?: Styles; | ||
}; | ||
didParseCell?: (data: CellHookData) => void; | ||
willDrawCell?: (data: CellHookData) => void; | ||
didDrawCell?: (data: CellHookData) => void; | ||
didDrawPage?: (data: CellHookData) => void; | ||
didParseCell?: CellHook; | ||
willDrawCell?: CellHook; | ||
didDrawCell?: CellHook; | ||
didDrawPage?: PageHook; | ||
} | ||
export interface ContentConfig extends BaseConfig { | ||
head?: SingleRowType | MultipleRowType; | ||
foot?: SingleRowType | MultipleRowType; | ||
body: MultipleRowType; | ||
export interface ColumnOption { | ||
header?: string; | ||
title?: string; | ||
footer?: string; | ||
dataKey?: string | number; | ||
key?: string | number; | ||
} | ||
export interface ColumnDataConfig extends BaseConfig { | ||
columns?: ColumnOption[]; | ||
body: object[]; | ||
export declare type Color = [number, number, number] | number | string | false; | ||
export declare type MarginPaddingInput = number | number[] | { | ||
top?: number; | ||
right?: number; | ||
bottom?: number; | ||
left?: number; | ||
horizontal?: number; | ||
vertical?: number; | ||
}; | ||
export interface CellDef { | ||
rowSpan?: number; | ||
colSpan?: number; | ||
styles?: Partial<Styles>; | ||
content?: string | string[] | number; | ||
title?: string; | ||
_element?: HTMLTableCellElement; | ||
} | ||
export interface HTMLConfig extends BaseConfig { | ||
html: string | HTMLElement; | ||
declare class HtmlRowInput extends Array<CellInput> { | ||
_element: HTMLTableRowElement; | ||
constructor(element: HTMLTableRowElement); | ||
} | ||
export declare function applyPlugin(jsPDF: any): void; | ||
export declare type CellInput = null | string | string[] | number | boolean | CellDef; | ||
export declare type RowInput = { | ||
[key: string]: CellInput; | ||
} | HtmlRowInput | CellInput[]; | ||
export declare function applyPlugin(jsPDF: jsPDFConstructor): void; | ||
export declare type autoTable = (options: UserOptions) => void; | ||
export {}; |
/*! | ||
* | ||
* jsPDF AutoTable plugin v3.4.4 | ||
* jsPDF AutoTable plugin v3.4.5 | ||
* | ||
@@ -10,2 +10,2 @@ * Copyright (c) 2020 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable | ||
*/ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(function(){try{return require("jspdf")}catch(t){}}());else if("function"==typeof define&&define.amd)define(["jspdf"],e);else{var n="object"==typeof exports?e(function(){try{return require("jspdf")}catch(t){}}()):e(t.jsPDF);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(this,(function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o,r=null,i=null;e.globalDefaults={},e.documentDefaults={},e.default=function(){return i},e.getGlobalOptions=function(){return e.globalDefaults},e.getDocumentOptions=function(){return e.documentDefaults};var a=function(){function t(t){this.doc=t}return t.prototype.pageHeight=function(){return this.pageSize().height},t.prototype.pageWidth=function(){return this.pageSize().width},t.prototype.pageSize=function(){var t=this.doc.internal.pageSize;return null==t.width&&(t={width:t.getWidth(),height:t.getHeight()}),t},t.prototype.scaleFactor=function(){return this.doc.internal.scaleFactor},t.prototype.pageNumber=function(){var t=this.doc.internal.getCurrentPageInfo();return t?t.pageNumber:this.doc.internal.getNumberOfPages()},t}();e.setupState=function(t){o=i,i=new a(t),t!==r&&(r=t,e.documentDefaults={})},e.resetState=function(){i=o},e.setDefaults=function(t,n){void 0===n&&(n=null),n?(e.documentDefaults=t||{},r=n):e.globalDefaults=t||{}}},function(t,e,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,l=i.length;a<l;a++,r++)o[r]=i[a];return o};Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=n(0),l=n(3);function s(t,e){return u(e,!0),(Array.isArray(t)?t:[t]).map((function(t){return a.default().doc.getTextWidth(t)})).map((function(t){return Math.floor(1e4*t)/1e4})).reduce((function(t,e){return Math.max(t,e)}),0)}function d(t){var e=t.lineWidth>0,n=t.fillColor||0===t.fillColor;return e&&n?"DF":e?"S":!!n&&"F"}function u(t,e){void 0===e&&(e=!1);var n=a.default().doc,r={fillColor:n.setFillColor,textColor:n.setTextColor,lineColor:n.setDrawColor,lineWidth:n.setLineWidth},i=o({fontStyle:n.setFontStyle,font:n.setFont,fontSize:n.setFontSize},e?{}:r);Object.keys(i).forEach((function(e){var n=t[e],o=i[e];void 0!==n&&(Array.isArray(n)?o.apply(void 0,n):o(n))}))}e.getStringWidth=s,e.ellipsize=function t(e,n,o,r){if(void 0===r&&(r="..."),Array.isArray(e))return e.map((function(e){return t(e,n,o,r)}));var i=1e4*a.default().scaleFactor();if((n=Math.ceil(n*i)/i)>=s(e,o))return e;for(;n<s(e+r,o)&&!(e.length<=1);)e=e.substring(0,e.length-1);return e.trim()+r},e.addTableBorder=function(){var t=a.default().table,e={lineWidth:t.settings.tableLineWidth,lineColor:t.settings.tableLineColor};u(e);var n=d(e);n&&a.default().doc.rect(t.pageStartX,t.pageStartY,t.width,t.cursor.y-t.pageStartY,n)},e.getFillStyle=d,e.applyUserStyles=function(){u(a.default().table.userStyles)},e.applyStyles=u,e.marginOrPadding=function(t,e){var n={};if(Array.isArray(t))t.length>=4?n={top:t[0],right:t[1],bottom:t[2],left:t[3]}:3===t.length?n={top:t[0],right:t[1],bottom:t[2],left:t[1]}:2===t.length?n={top:t[0],right:t[1],bottom:t[0],left:t[1]}:t=1===t.length?t[0]:e;else if("object"==typeof t){t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal);for(var o=0,r=["top","right","bottom","left"];o<r.length;o++){var i=r[o];n[i]=t[i]||0===t[i]?t[i]:e}}return"number"==typeof t&&(n={top:t,right:t,bottom:t,left:t}),n},e.styles=function(t){return t=Array.isArray(t)?t:[t],l.assign.apply(void 0,r([i.defaultStyles()],t))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0);e.FONT_ROW_RATIO=1.15,e.defaultConfig=function(){return{html:null,head:null,body:null,foot:null,includeHiddenHtml:!1,startY:null,margin:40/o.default().scaleFactor(),pageBreak:"auto",rowPageBreak:"auto",tableWidth:"auto",showHead:"everyPage",showFoot:"everyPage",tableLineWidth:0,tableLineColor:200,tableId:null,theme:"striped",useCss:!1,styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{},didParseCell:function(t){},willDrawCell:function(t){},didDrawCell:function(t){},didDrawPage:function(t){}}},e.defaultStyles=function(){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/o.default().scaleFactor(),lineColor:200,lineWidth:0/o.default().scaleFactor(),cellWidth:"auto",minCellHeight:0}},e.getTheme=function(t){return{striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[t]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])}return o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,o,r){o=o||{};var i=r.internal.scaleFactor,a=r.internal.getFontSize()/i,l="",s=1;if("middle"!==o.valign&&"bottom"!==o.valign&&"center"!==o.halign&&"right"!==o.halign||(s=(l="string"==typeof t?t.split(/\r\n|\r|\n/g):t).length||1),n+=a*(2-1.15),"middle"===o.valign?n-=s/2*a*1.15:"bottom"===o.valign&&(n-=s*a*1.15),"center"===o.halign||"right"===o.halign){var d=a;if("center"===o.halign&&(d*=.5),l&&s>=1){for(var u=0;u<l.length;u++)r.text(l[u],e-r.getStringUnitWidth(l[u])*d,n),n+=1.15*a;return r}e-=r.getStringUnitWidth(t)*d}return"justify"===o.halign?r.text(t,e,n,{maxWidth:o.maxWidth||100,align:"justify"}):r.text(t,e,n),r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),r=n(0);function i(t,e,n,i){for(var l=[],s=i?o.parseCss(e,r.default().scaleFactor(),["cellPadding","lineWidth","lineColor"]):{},d=0;d<e.cells.length;d++){var u=e.cells[d],h=t.getComputedStyle(u);if(n||"none"!==h.display){var c=i?o.parseCss(u,r.default().scaleFactor()):{};l.push({rowSpan:u.rowSpan,colSpan:u.colSpan,styles:i?c:null,_element:u,content:a(u)})}}if(l.length>0&&(n||"none"!==s.display))return l._element=e,l}function a(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split("<br>").map((function(t){return t.trim()})).join("\n"),e.innerText||e.textContent||""}e.parseHtml=function(t,e,n){var o;void 0===e&&(e=!1),void 0===n&&(n=!1);var r=[],a=[],l=[];if(!(o="string"==typeof t?window.document.querySelector(t):t))return console.error("Html table could not be found with input: ",t),{head:r,body:a,foot:l};for(var s=0,d=o.rows;s<d.length;s++){var u=d[s],h=u.parentNode.tagName.toLowerCase(),c=i(window,u,e,n);c&&("thead"===h?r.push(c):"tfoot"===h?l.push(c):a.push(c))}return{head:r,body:a,foot:l}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),r=n(0),i=n(12),a=n(1),l=n(3),s=function(){this.didParseCell=[],this.willDrawCell=[],this.didDrawCell=[],this.didDrawPage=[]},d=function(){function t(){this.cursor={x:0,y:0},this.columns=[],this.head=[],this.body=[],this.foot=[],this.wrappedWidth=0,this.minWidth=0,this.width=0,this.height=0,this.headHeight=0,this.footHeight=0,this.startPageNumber=1,this.pageNumber=1,this.pageCount=1,this.pageStartX=0,this.pageStartY=0,this.finalY=0,this.styles={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},this.cellHooks=new s}return t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(t,e,n,o){for(var r=0,a=t;r<a.length;r++){if(!1===(0,a[r])(new i.CellHookData(e,n,o)))return!1}return!0},t.prototype.callEndPageHooks=function(){a.applyUserStyles();for(var t=0,e=this.cellHooks.didDrawPage;t<e.length;t++){(0,e[t])(new i.HookData)}},t.prototype.margin=function(t){return a.marginOrPadding(this.settings.margin,o.defaultConfig().margin)[t]},t}();e.Table=d;var u=function(){function t(t,e,n){this.cells={},this.height=0,this.maxCellHeight=0,this.x=0,this.y=0,this.spansMultiplePages=!1,this.raw=t,t._element&&(this.raw=t._element),this.index=e,this.section=n}return t.prototype.hasRowSpan=function(){var t=this;return r.default().table.columns.filter((function(e){var n=t.cells[e.index];return!!n&&n.rowSpan>1})).length>0},t.prototype.canEntireRowFit=function(t){return this.maxCellHeight<=t},t.prototype.getMinimumRowHeight=function(){var t=this;return r.default().table.columns.reduce((function(e,n){var i=t.cells[n.index];if(!i)return 0;var a=i.styles.fontSize/r.default().scaleFactor()*o.FONT_ROW_RATIO,l=i.padding("vertical")+a;return l>e?l:e}),0)},t}();e.Row=u;var h=function(){function t(t,e,n){var o;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.textPos={y:0,x:0},this.x=0,this.y=0,this.rowSpan=t&&t.rowSpan||1,this.colSpan=t&&t.colSpan||1,this.styles=l.assign(e,t&&t.styles||{}),this.section=n;var r=t&&null!=t.content?t.content:t;r=r&&null!=r.title?r.title:r,this.raw=t&&t._element?t._element:t,o=null!=r?""+r:"";this.text=o.split(/\r\n|\r|\n/g)}return t.prototype.getContentHeight=function(){return(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/r.default().scaleFactor()*o.FONT_ROW_RATIO)+this.padding("vertical")},t.prototype.padding=function(t){var e=a.marginOrPadding(this.styles.cellPadding,a.styles([]).cellPadding);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},t}();e.Cell=h;var c=function(){function t(t,e,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=n}return t.prototype.getMaxCustomCellWidth=function(){for(var t=0,e=0,n=r.default().table.allRows();e<n.length;e++){var o=n[e].cells[this.index];o&&"number"==typeof o.styles.cellWidth&&(t=Math.max(t,o.styles.cellWidth))}return t},t}();e.Column=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8);function r(t){o.default(t)}e.applyPlugin=r;try{r(n(16))}catch(t){}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0);n(4);var r=n(5),i=n(4),a=n(10);e.default=function(t){t.API.autoTable=a.default,t.API.lastAutoTable=!1,t.API.previousAutoTable=!1,t.API.autoTable.previous=!1,t.API.autoTableText=function(t,e,n,o){i.default(t,e,n,o,this)},t.API.autoTableSetDefaults=function(t){return o.setDefaults(t,this),this},t.autoTableSetDefaults=function(t,e){return o.setDefaults(t,e),this},t.API.autoTableHtmlToJson=function(t,e){if(e=e||!1,!(t&&t instanceof HTMLTableElement))return console.error("An HTMLTableElement has to be sent to autoTableHtmlToJson"),null;var n=r.parseHtml(t,e,!1),o=n.head,i=n.body,a=n.foot;return{columns:o[0]||i[0]||a[0],rows:i,data:i}},t.API.autoTableEndPosY=function(){console.error("Use of deprecated function: autoTableEndPosY. Use doc.previousAutoTable.finalY instead.");var t=this.previousAutoTable;return t.cursor&&"number"==typeof t.cursor.y?t.cursor.y:0},t.API.autoTableAddPageContent=function(e){return console.error("Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead."),t.API.autoTable.globalDefaults||(t.API.autoTable.globalDefaults={}),t.API.autoTable.globalDefaults.addPageContent=e,this},t.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(0);function i(t,e){var n=function t(e,n){if(!e)return null;var o=window.getComputedStyle(e)[n];return"rgba(0, 0, 0, 0)"===o||"transparent"===o||"initial"===o||"inherit"===o?t(e.parentElement,n):o}(t,e);if(!n)return null;var o=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!o||!Array.isArray(o))return null;var r=[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])];return 0===parseInt(o[4])||isNaN(r[0])||isNaN(r[1])||isNaN(r[2])?null:r}e.parseCss=function(t,e,n){void 0===n&&(n=[]);var a={},l=window.getComputedStyle(t);function s(t,e,o){void 0===o&&(o=[]),0!==o.length&&-1===o.indexOf(e)||-1!==n.indexOf(t)||(0===e||e)&&(a[t]=e)}s("fillColor",i(t,"backgroundColor")),s("fontStyle",function(t){var e="";("bold"===t.fontWeight||"bolder"===t.fontWeight||parseInt(t.fontWeight)>=700)&&(e+="bold");"italic"!==t.fontStyle&&"oblique"!==t.fontStyle||(e+="italic");return e}(l)),s("textColor",i(t,"color")),s("halign",l.textAlign,["left","right","center","justify"]),s("valign",l.verticalAlign,["middle","bottom","top"]),s("fontSize",parseInt(l.fontSize||"")/(96/72)),s("cellPadding",function(t,e,n,r){if(!t)return null;var i=96/(72/r),a=(parseInt(n)-parseInt(e))/r/2,l=t.map((function(t){return parseInt(t)/i})),s=o.marginOrPadding(l,0);a>s.top&&(s.top=a);a>s.bottom&&(s.bottom=a);return s}([l.paddingTop,l.paddingRight,l.paddingBottom,l.paddingLeft],l.fontSize,l.lineHeight,e)),s("lineWidth",parseInt(l.borderTopWidth||"")/(96/72)/e),s("lineColor",i(t,"borderTopColor"));var d=(l.fontFamily||"").toLowerCase();return r.default().doc.getFontList()[d]&&s("font",d),a}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(11),i=n(14),a=n(15),l=n(1);e.default=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o.setupState(this);var n=r.parseInput(t);return i.calculateWidths(n),a.drawTable(n),n.finalY=n.cursor.y,this.previousAutoTable=n,this.lastAutoTable=n,this.autoTable.previous=n,l.applyUserStyles(),o.resetState(),this}},function(t,e,n){"use strict";var o=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,l=i.length;a<l;a++,r++)o[r]=i[a];return o};Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),i=n(2),a=n(5),l=n(3),s=n(1),d=n(0),u=n(13);function h(t,e,n){var r=d.default().table,a=i.getTheme(r.settings.theme),s=[a.table,a[t],r.styles.styles,r.styles[t+"Styles"]],u=r.styles.columnStyles[e.dataKey]||r.styles.columnStyles[e.index]||{},h="body"===t?u:{},c="body"===t&&n%2==0?l.assign({},a.alternateRow,r.styles.alternateRowStyles):{};return l.assign.apply(void 0,o([i.defaultStyles()],o(s,[c,h])))}e.parseInput=function(t){var e=function(t){if(1===t.length)return t[0];var e=t[2]||{};return e.body=t[1],e.columns=t[0],e.columns.forEach((function(t){"object"==typeof t&&null==t.header&&(t.header=t.title)})),e}(t),n=[d.getGlobalOptions(),d.getDocumentOptions(),e];u.default(n);var c=new r.Table;d.default().table=c,c.id=e.tableId;var f=d.default().doc;c.userStyles={textColor:f.getTextColor?f.getTextColor():0,fontSize:f.internal.getFontSize(),fontStyle:f.internal.getFont().fontStyle,font:f.internal.getFont().fontName};for(var g=function(t){var e=n.map((function(e){return e[t]||{}}));c.styles[t]=l.assign.apply(void 0,o([{}],e))},p=0,y=Object.keys(c.styles);p<y.length;p++){g(y[p])}for(var v=0,m=n;v<m.length;v++)for(var b=m[v],w=0,x=Object.keys(c.cellHooks);w<x.length;w++){var S=x[w];b&&"function"==typeof b[S]&&c.cellHooks[S].push(b[S])}c.settings=l.assign.apply(void 0,o([{},i.defaultConfig()],n)),c.settings.margin=s.marginOrPadding(c.settings.margin,i.defaultConfig().margin),"auto"===c.settings.theme&&(c.settings.theme=c.settings.useCss?"plain":"striped"),!1===c.settings.startY&&delete c.settings.startY;var P=d.default().doc.previousAutoTable,C=P&&P.startPageNumber+P.pageNumber-1===d.default().pageNumber();null==c.settings.startY&&C&&(c.settings.startY=P.finalY+20/d.default().scaleFactor());var W={};return c.settings.html&&(W=a.parseHtml(c.settings.html,c.settings.includeHiddenHtml,c.settings.useCss)||{}),c.settings.head=W.head||c.settings.head||[],c.settings.body=W.body||c.settings.body||[],c.settings.foot=W.foot||c.settings.foot||[],function(t){var e=t.settings;t.columns=function(t){if(t.columns)return t.columns.map((function(t,e){var n=t.dataKey||t.key||e;return new r.Column(n,t,e)}));var e=t.head[0]||t.body[0]||t.foot[0]||[],n=[];return Object.keys(e).filter((function(t){return"_element"!==t})).forEach((function(t){for(var o=e[t]&&e[t].colSpan?e[t].colSpan:1,i=0;i<o;i++){var a=void 0;a=Array.isArray(e)?n.length:t+(i>0?"_"+i:""),n.push(new r.Column(a,a,n.length))}})),n}(e);for(var n=function(n){var o={},i=e[n];if(0===i.length&&e.columns&&"body"!==n){var a=function(t,e){var n={};return t.columns.forEach((function(t){var o=t.raw;if("head"===e){var r=o&&o.header?o.header:o;r&&(n[t.dataKey]=r)}else"foot"===e&&o.footer&&(n[t.dataKey]=o.footer)})),Object.keys(n).length>0?n:null}(t,n);a&&i.push(a)}i.forEach((function(e,i){var a=0,l=new r.Row(e,i,n);t[n].push(l);for(var s=0,d=0,u=0,c=t.columns;u<c.length;u++){var f=c[u];if(null==o[f.index]||0===o[f.index].left)if(0===d){var g=void 0;g=Array.isArray(e)?e[f.index-s-a]:e[f.dataKey];var p=h(n,f,i),y=new r.Cell(g,p,n);l.cells[f.dataKey]=y,l.cells[f.index]=y,d=y.colSpan-1,o[f.index]={left:y.rowSpan-1,times:d}}else d--,s++;else o[f.index].left--,d=o[f.index].times,a++}}))},o=0,i=["head","body","foot"];o<i.length;o++){n(i[o])}t.allRows().forEach((function(e){for(var n=0,o=t.columns;n<o.length;n++){var r=o[n],i=e.cells[r.index];if(i){t.callCellHooks(t.cellHooks.didParseCell,i,e,r),i.text=Array.isArray(i.text)?i.text:[i.text],i.contentWidth=s.getStringWidth(i.text,i.styles)+i.padding("horizontal");var a=s.getStringWidth(i.text.join(" ").split(/\s+/),i.styles);if(i.minReadableWidth=a+i.padding("horizontal"),"number"==typeof i.styles.cellWidth)i.minWidth=i.styles.cellWidth,i.wrappedWidth=i.styles.cellWidth;else if("wrap"===i.styles.cellWidth)i.minWidth=i.contentWidth,i.wrappedWidth=i.contentWidth;else{var l=10/d.default().scaleFactor();i.minWidth=i.styles.minCellWidth||l,i.wrappedWidth=i.contentWidth,i.minWidth>i.wrappedWidth&&(i.wrappedWidth=i.minWidth)}}}})),t.allRows().forEach((function(e){for(var n=0,o=t.columns;n<o.length;n++){var r=o[n],i=e.cells[r.index];if(i&&1===i.colSpan)r.wrappedWidth=Math.max(r.wrappedWidth,i.wrappedWidth),r.minWidth=Math.max(r.minWidth,i.minWidth),r.minReadableWidth=Math.max(r.minReadableWidth,i.minReadableWidth);else{var a=(t.styles.columnStyles[r.dataKey]||t.styles.columnStyles[r.index]||{}).cellWidth;a&&"number"==typeof a&&(r.minWidth=a,r.wrappedWidth=a)}i&&(i.colSpan>1&&!r.minWidth&&(r.minWidth=i.minWidth),i.colSpan>1&&!r.wrappedWidth&&(r.wrappedWidth=i.minWidth))}}))}(c),c.minWidth=c.columns.reduce((function(t,e){return t+e.minWidth}),0),c.wrappedWidth=c.columns.reduce((function(t,e){return t+e.wrappedWidth}),0),"number"==typeof c.settings.tableWidth?c.width=c.settings.tableWidth:"wrap"===c.settings.tableWidth?c.width=c.wrappedWidth:c.width=d.default().pageWidth()-c.margin("left")-c.margin("right"),c}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),a=function(){var t=i.default().table;this.table=t,this.pageNumber=t.pageNumber,this.pageCount=this.pageNumber,this.settings=t.settings,this.cursor=t.cursor,this.doc=i.default().doc};e.HookData=a;var l=function(t){function e(e,n,o){var r=t.call(this)||this;return r.cell=e,r.row=n,r.column=o,r.section=n.section,r}return r(e,t),e}(a);e.CellHookData=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);function r(t){t.rowHeight?(console.error("Use of deprecated style rowHeight. It is renamed to minCellHeight."),t.minCellHeight||(t.minCellHeight=t.rowHeight)):t.columnWidth&&(console.error("Use of deprecated style columnWidth. It is renamed to cellWidth."),t.cellWidth||(t.cellWidth=t.columnWidth))}e.default=function(t){for(var e=function(t){t&&"object"!=typeof t&&console.error("The options parameter should be of type object, is: "+typeof t),void 0!==t.extendWidth&&(t.tableWidth=t.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),void 0!==t.margins&&(void 0===t.margin&&(t.margin=t.margins),console.error("Use of deprecated option: margins, use margin instead.")),t.startY&&"number"!=typeof t.startY&&(console.error("Invalid value for startY option",t.startY),delete t.startY),!t.didDrawPage&&(t.afterPageContent||t.beforePageContent||t.afterPageAdd)&&(console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead"),t.didDrawPage=function(e){o.applyUserStyles(),t.beforePageContent&&t.beforePageContent(e),o.applyUserStyles(),t.afterPageContent&&t.afterPageContent(e),o.applyUserStyles(),t.afterPageAdd&&e.pageNumber>1&&e.afterPageAdd(e),o.applyUserStyles()}),["createdHeaderCell","drawHeaderRow","drawRow","drawHeaderCell"].forEach((function(e){t[e]&&console.error('The "'+e+'" hook has changed in version 3.0, check the changelog for how to migrate.')})),[["showFoot","showFooter"],["showHead","showHeader"],["didDrawPage","addPageContent"],["didParseCell","createdCell"],["headStyles","headerStyles"]].forEach((function(e){var n=e[0],o=e[1];t[o]&&(console.error("Use of deprecated option "+o+". Use "+n+" instead"),t[n]=t[o])})),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach((function(e){var n="string"==typeof e?e:e[0],o="string"==typeof e?e:e[1];void 0!==t[n]&&(void 0===t.styles[o]&&(t.styles[o]=t[n]),console.error("Use of deprecated option: "+n+", use the style "+o+" instead."))}));for(var e=0,n=["styles","bodyStyles","headStyles","footStyles"];e<n.length;e++){r(t[n[e]]||{})}for(var i=t.columnStyles||{},a=0,l=Object.keys(i);a<l.length;a++){r(i[l[a]]||{})}},n=0,i=t;n<i.length;n++){e(i[n])}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(0);function i(t,e,n){for(var o=e,r=t.reduce((function(t,e){return t+e.wrappedWidth}),0),a=0;a<t.length;a++){var l=t[a],s=o*(l.wrappedWidth/r),d=l.width+s,u=n(l),h=d<u?u:d;e-=h-l.width,l.width=h}if(e=Math.round(1e10*e)/1e10){var c=t.filter((function(t){return!(e<0)||t.width>n(t)}));c.length&&(e=i(c,e,n))}return e}e.calculateWidths=function(t){var e=[],n=0;t.columns.forEach((function(t){var o=t.getMaxCustomCellWidth();o?t.width=o:(t.width=t.wrappedWidth,e.push(t)),n+=t.width}));var a=t.width-n;a&&(a=i(e,a,(function(t){return Math.max(t.minReadableWidth,t.minWidth)}))),a&&(a=i(e,a,(function(t){return t.minWidth}))),(a=Math.abs(a))>1e-10&&(a=a<1?a:Math.round(a),console.error("Of the table content, "+a+" units width could not fit page")),function(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var o=e[n],r=null,i=0,a=0,l=0;l<t.columns.length;l++){var s=t.columns[l];if((a-=1)>1&&t.columns[l+1])i+=s.width,delete o.cells[s.index];else if(r){var d=r;delete o.cells[s.index],r=null,d.width=s.width+i}else{if(!(d=o.cells[s.index]))continue;if(a=d.colSpan,i=0,d.colSpan>1){r=d,i+=s.width;continue}d.width=s.width+i}}}(t),function(t){for(var e={count:0,height:0},n=0,i=t.allRows();n<i.length;n++){for(var a=i[n],l=0,s=t.columns;l<s.length;l++){var d=s[l],u=a.cells[d.index];if(u){o.applyStyles(u.styles,!0);var h=u.width-u.padding("horizontal");"linebreak"===u.styles.overflow?u.text=r.default().doc.splitTextToSize(u.text,h+1/(r.default().scaleFactor()||1),{fontSize:u.styles.fontSize}):"ellipsize"===u.styles.overflow?u.text=o.ellipsize(u.text,h,u.styles):"hidden"===u.styles.overflow?u.text=o.ellipsize(u.text,h,u.styles,""):"function"==typeof u.styles.overflow&&(u.text=u.styles.overflow(u.text,h)),u.contentHeight=u.getContentHeight(),u.styles.minCellHeight>u.contentHeight&&(u.contentHeight=u.styles.minCellHeight);var c=u.contentHeight/u.rowSpan;u.rowSpan>1&&e.count*e.height<c*u.rowSpan?e={height:c,count:u.rowSpan}:e&&e.count>0&&e.height>c&&(c=e.height),c>a.height&&(a.height=c,a.maxCellHeight=c)}}e.count--}}(t),function(t){for(var e={},n=1,o=t.allRows(),r=0;r<o.length;r++){for(var i=o[r],a=0,l=t.columns;a<l.length;a++){var s=l[a],d=e[s.index];if(n>1)n--,delete i.cells[s.index];else if(d)d.cell.height+=i.height,d.cell.height>i.maxCellHeight&&(d.row.maxCellHeight=d.cell.height),n=d.cell.colSpan,delete i.cells[s.index],d.left--,d.left<=1&&delete e[s.index];else{var u=i.cells[s.index];if(!u)continue;if(u.height=i.height,u.rowSpan>1){var h=o.length-r,c=u.rowSpan>h?h:u.rowSpan;e[s.index]={cell:u,left:c,row:i}}}}"head"===i.section&&(t.headHeight+=i.maxCellHeight),"foot"===i.section&&(t.footHeight+=i.maxCellHeight),t.height+=i.height}}(t)},e.resizeColumns=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),r=n(1),i=n(6),a=n(0),l=n(3);function s(t,e){var n=t.styles.fontSize/a.default().scaleFactor()*o.FONT_ROW_RATIO,r=t.padding("vertical"),i=Math.floor((e-r)/n);return Math.max(0,i)}function d(t){var e=a.default().table;e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x;for(var n=0,o=e.columns;n<o.length;n++){var i=o[n],l=t.cells[i.index];if(l){if(r.applyStyles(l.styles),l.x=e.cursor.x,l.y=t.y,"top"===l.styles.valign)l.textPos.y=e.cursor.y+l.padding("top");else if("bottom"===l.styles.valign)l.textPos.y=e.cursor.y+l.height-l.padding("bottom");else{var s=l.height-l.padding("vertical");l.textPos.y=e.cursor.y+s/2+l.padding("top")}if("right"===l.styles.halign)l.textPos.x=l.x+l.width-l.padding("right");else if("center"===l.styles.halign){var d=l.width-l.padding("horizontal");l.textPos.x=l.x+d/2+l.padding("left")}else l.textPos.x=l.x+l.padding("left");if(!1!==e.callCellHooks(e.cellHooks.willDrawCell,l,t,i)){var u=r.getFillStyle(l.styles);u&&a.default().doc.rect(l.x,e.cursor.y,l.width,l.height,u),a.default().doc.autoTableText(l.text,l.textPos.x,l.textPos.y,{halign:l.styles.halign,valign:l.styles.valign,maxWidth:Math.ceil(l.width-l.padding("left")-l.padding("right"))}),e.callCellHooks(e.cellHooks.didDrawCell,l,t,i),e.cursor.x+=i.width}else e.cursor.x+=i.width}else e.cursor.x+=i.width}e.cursor.y+=t.height}function u(){var t=a.default().table;r.applyUserStyles(),!0!==t.settings.showFoot&&"everyPage"!==t.settings.showFoot||t.foot.forEach((function(t){return d(t)})),t.finalY=t.cursor.y,t.callEndPageHooks(),r.addTableBorder(),h(a.default().doc),t.pageNumber++,t.pageCount++,t.cursor={x:t.margin("left"),y:t.margin("top")},t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,!0!==t.settings.showHead&&"everyPage"!==t.settings.showHead||t.head.forEach((function(t){return d(t)}))}function h(t){var e=a.default().pageNumber();t.setPage(e+1),a.default().pageNumber()===e&&t.addPage()}e.drawTable=function(t){var e=t.settings;t.cursor={x:t.margin("left"),y:null==e.startY?t.margin("top"):e.startY};var n=e.startY+t.margin("bottom")+t.headHeight+t.footHeight;"avoid"===e.pageBreak&&(n+=t.height),("always"===e.pageBreak||null!=e.startY&&!1!==e.startY&&n>a.default().pageHeight())&&(h(a.default().doc),t.cursor.y=t.margin("top")),t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,t.startPageNumber=a.default().pageNumber(),r.applyUserStyles(),!0!==e.showHead&&"firstPage"!==e.showHead&&"everyPage"!==e.showHead||t.head.forEach((function(t){return d(t)})),r.applyUserStyles(),t.body.forEach((function(e,n){!function t(e,n){var o=a.default().table,r=function(t){var e=a.default().table,n=e.margin("bottom"),o=e.settings.showFoot;(!0===o||"everyPage"===o||"lastPage"===o&&t)&&(n+=e.footHeight);return a.default().pageHeight()-e.cursor.y-n}(n);if(e.canEntireRowFit(r))d(e);else if(function(t,e,n){var o=a.default().pageHeight(),r=n.margin("top")+n.margin("bottom"),i=o-r;"body"===t.section&&(i-=n.headHeight+n.footHeight);var l=t.getMinimumRowHeight()<e;if(t.getMinimumRowHeight()>i)return console.error("Will not be able to print row "+t.index+" correctly since it's minimum height is larger than page height"),!0;var s=t.hasRowSpan();if(!l)return!1;if(t.maxCellHeight>i)return s&&console.error("The content of row "+t.index+" will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported."),!0;if(s)return!1;if("avoid"===n.settings.rowPageBreak)return!1;return!0}(e,r,o)){var h=function(t,e,n){var o=new i.Row(t.raw,-1,t.section);o.spansMultiplePages=!0,t.spansMultiplePages=!0,t.height=0,t.maxCellHeight=0;for(var r=0,a=n.columns;r<a.length;r++){var d=a[r];if(g=t.cells[d.index]){Array.isArray(g.text)||(g.text=[g.text]);var u=new i.Cell(g.raw,{},g.section);(u=l.assign(u,g)).textPos=l.assign({},g.textPos),u.text=[];var h=s(g,e);g.text.length>h&&(u.text=g.text.splice(h,g.text.length)),g.contentHeight=g.getContentHeight(),g.contentHeight>t.height&&(t.height=g.contentHeight,t.maxCellHeight=g.contentHeight),u.contentHeight=u.getContentHeight(),u.contentHeight>o.height&&(o.height=u.contentHeight,o.maxCellHeight=u.contentHeight),o.cells[d.index]=u}}for(var c=0,f=n.columns;c<f.length;c++){var g;d=f[c];(u=o.cells[d.index])&&(u.height=o.height),(g=t.cells[d.index])&&(g.height=t.height)}return o}(e,r,o);d(e),u(),t(h,n)}else u(),t(e,n)}(e,n===t.body.length-1)})),r.applyUserStyles(),!0!==e.showFoot&&"lastPage"!==e.showFoot&&"everyPage"!==e.showFoot||t.foot.forEach((function(t){return d(t)})),r.addTableBorder(),t.callEndPageHooks()},e.addPage=u},function(e,n){if(void 0===t){var o=new Error("Cannot find module 'undefined'");throw o.code="MODULE_NOT_FOUND",o}e.exports=t}])})); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(function(){try{return require("jspdf")}catch(t){}}());else if("function"==typeof define&&define.amd)define(["jspdf"],e);else{var n="object"==typeof exports?e(function(){try{return require("jspdf")}catch(t){}}()):e(t.jsPDF);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(this,(function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(t,e,n){"use strict";function o(t,e){var n=t>0,o=e||0===e;return n&&o?"DF":n?"S":o?"F":null}Object.defineProperty(e,"__esModule",{value:!0}),e.getStringWidth=function(t,e,n){return n.applyStyles(e,!0),(Array.isArray(t)?t:[t]).map((function(t){return n.getTextWidth(t)})).reduce((function(t,e){return Math.max(t,e)}),0)},e.addTableBorder=function(t,e){var n=t.settings.tableLineWidth,r=t.settings.tableLineColor;e.applyStyles({lineWidth:n,lineColor:r});var i=o(n,!1);i&&e.rect(t.pageStartX,t.pageStartY,t.width,t.cursor.y-t.pageStartY,i)},e.getFillStyle=o,e.marginOrPadding=function(t,e){var n,o,r,i;if(t=t||e,Array.isArray(t)){if(t.length>=4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(3===t.length)return{top:t[0],right:t[1],bottom:t[2],left:t[1]};if(2===t.length)return{top:t[0],right:t[1],bottom:t[0],left:t[1]};t=1===t.length?t[0]:e}return"object"==typeof t?("number"==typeof t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),"number"==typeof t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal),{left:null!==(n=t.left)&&void 0!==n?n:e,top:null!==(o=t.top)&&void 0!==o?o:e,right:null!==(r=t.right)&&void 0!==r?r:e,bottom:null!==(i=t.bottom)&&void 0!==i?i:e}):("number"!=typeof t&&(t=e),{top:t,right:t,bottom:t,left:t})}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FONT_ROW_RATIO=1.15;var i=function(t){function e(e){var n=t.call(this)||this;return n._element=e,n}return r(e,t),e}(Array);e.HtmlRowInput=i,e.defaultStyles=function(t){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/t,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}},e.getTheme=function(t){return{striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[t]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),r=n(1);function i(t,e,n,i,a,s){for(var u=new r.HtmlRowInput(i),d=0;d<i.cells.length;d++){var h=i.cells[d],c=n.getComputedStyle(h);if(a||"none"!==c.display){var f=void 0;s&&(f=o.parseCss(t,h,e,c,n)),u.push({rowSpan:h.rowSpan,colSpan:h.colSpan,styles:f,_element:h,content:l(h)})}}var g=n.getComputedStyle(i);if(u.length>0&&(a||"none"!==g.display))return u}function l(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split("<br>").map((function(t){return t.trim()})).join("\n"),e.innerText||e.textContent||""}e.parseHtml=function(t,e,n,o,r){var l,a,s;void 0===o&&(o=!1),void 0===r&&(r=!1),s="string"==typeof e?n.document.querySelector(e):e;var u=Object.keys(t.getFontList()),d=t.scaleFactor(),h=[],c=[],f=[];if(!s)return console.error("Html table could not be found with input: ",e),{head:h,body:c,foot:f};for(var g=0;g<s.rows.length;g++){var p=s.rows[g],y=null===(a=null===(l=null==p?void 0:p.parentElement)||void 0===l?void 0:l.tagName)||void 0===a?void 0:a.toLowerCase(),v=i(u,d,n,p,o,r);v&&("thead"===y?h.push(v):"tfoot"===y?f.push(v):c.push(v))}return{head:h,body:c,foot:f}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,o,r){o=o||{};var i=r.internal.scaleFactor,l=r.internal.getFontSize()/i,a="",s=1;if("middle"!==o.valign&&"bottom"!==o.valign&&"center"!==o.halign&&"right"!==o.halign||(s=(a="string"==typeof t?t.split(/\r\n|\r|\n/g):t).length||1),n+=l*(2-1.15),"middle"===o.valign?n-=s/2*l*1.15:"bottom"===o.valign&&(n-=s*l*1.15),"center"===o.halign||"right"===o.halign){var u=l;if("center"===o.halign&&(u*=.5),a&&s>=1){for(var d=0;d<a.length;d++)r.text(a[d],e-r.getStringUnitWidth(a[d])*u,n),n+=1.15*l;return r}e-=r.getStringUnitWidth(t)*u}return"justify"===o.halign?r.text(t,e,n,{maxWidth:o.maxWidth||100,align:"justify"}):r.text(t,e,n),r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o={},r=function(){function t(t){this.jsPDFDocument=t,this.userStyles={textColor:t.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:t.internal.getFontSize(),fontStyle:t.internal.getFont().fontStyle,font:t.internal.getFont().fontName}}return t.setDefaults=function(t,e){void 0===e&&(e=null),e?e.__autoTableDocumentDefaults=t:o=t},t.unifyColor=function(t){return Array.isArray(t)?t:"number"==typeof t?[t,t,t]:"string"==typeof t?[t]:null},t.prototype.applyStyles=function(e,n){var o,r,i;if(void 0===n&&(n=!1),e.fontStyle&&this.jsPDFDocument.setFontStyle(e.fontStyle),e.font&&this.jsPDFDocument.setFont(e.font),e.fontSize&&this.jsPDFDocument.setFontSize(e.fontSize),!n){var l=t.unifyColor(e.fillColor);l&&(o=this.jsPDFDocument).setFillColor.apply(o,l),(l=t.unifyColor(e.textColor))&&(r=this.jsPDFDocument).setTextColor.apply(r,l),(l=t.unifyColor(e.lineColor))&&(i=this.jsPDFDocument).setDrawColor.apply(i,l),"number"==typeof e.lineWidth&&this.jsPDFDocument.setLineWidth(e.lineWidth)}},t.prototype.splitTextToSize=function(t,e,n){return this.jsPDFDocument.splitTextToSize(t,e,n)},t.prototype.rect=function(t,e,n,o,r){return this.jsPDFDocument.rect(t,e,n,o,r)},t.prototype.getPreviousAutoTable=function(){return this.jsPDFDocument.previousAutoTable},t.prototype.getTextWidth=function(t){return this.jsPDFDocument.getTextWidth(t)},t.prototype.getDocument=function(){return this.jsPDFDocument},t.prototype.setPage=function(t){this.jsPDFDocument.setPage(t)},t.prototype.addPage=function(){return this.jsPDFDocument.addPage()},t.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},t.prototype.getGlobalOptions=function(){return o||{}},t.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},t.prototype.pageSize=function(){var t=this.jsPDFDocument.internal.pageSize;return null==t.width&&(t={width:t.getWidth(),height:t.getHeight()}),t},t.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},t.prototype.pageNumber=function(){var t=this.jsPDFDocument.internal.getCurrentPageInfo();return t?t.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},t}();e.DocHandler=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assign=function(t,e,n,o,r){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),l=1;l<arguments.length;l++){var a=arguments[l];if(null!=a)for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(i[s]=a[s])}return i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(13),i=n(0),l=function(){function t(t,e,n,o,r){this.cursor={x:0,y:0},this.columns=[],this.head=[],this.body=[],this.foot=[],this.wrappedWidth=0,this.minWidth=0,this.width=0,this.height=0,this.headHeight=0,this.footHeight=0,this.startPageNumber=1,this.pageNumber=1,this.pageCount=1,this.pageStartX=0,this.pageStartY=0,this.finalY=0,this.id=t,this.settings=e,this.styles=n,this.hooks=o,this.columns=r.columns,this.head=r.head,this.body=r.body,this.foot=r.foot}return t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(t,e,n,o,i){for(var l=0,a=e;l<a.length;l++){var s=!1===(0,a[l])(new r.CellHookData(this,t,n,o,i));if(n.text=Array.isArray(n.text)?n.text:[n.text],s)return!1}return!0},t.prototype.callEndPageHooks=function(t){t.applyStyles(t.userStyles);for(var e=0,n=this.hooks.didDrawPage;e<n.length;e++){(0,n[e])(new r.HookData(this,t))}},t}();e.Table=l;var a=function(){function t(t,e,n){this.cells={},this.height=0,this.maxCellHeight=0,this.x=0,this.y=0,this.spansMultiplePages=!1,this.raw=t,t instanceof o.HtmlRowInput&&(this.raw=t._element,this.element=t._element),this.index=e,this.section=n}return t.prototype.hasRowSpan=function(t){var e=this;return t.filter((function(t){var n=e.cells[t.index];return!!n&&n.rowSpan>1})).length>0},t.prototype.canEntireRowFit=function(t){return this.maxCellHeight<=t},t.prototype.getMinimumRowHeight=function(t,e){var n=this;return t.reduce((function(t,r){var i=n.cells[r.index];if(!i)return 0;var l=i.styles.fontSize/e.scaleFactor()*o.FONT_ROW_RATIO,a=i.padding("vertical")+l;return a>t?a:t}),0)},t}();e.Row=a;var s=function(){function t(t,e,n){var o,r;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.textPos={y:0,x:0},this.x=0,this.y=0,this.colSpan=1,this.rowSpan=1,this.styles=e,this.section=n,this.raw=t;var i=t;null==t||"object"!=typeof t||Array.isArray(t)||(this.rowSpan=t.rowSpan||1,this.colSpan=t.colSpan||1,i=null!==(r=null!==(o=t.content)&&void 0!==o?o:t.title)&&void 0!==r?r:t,t._element&&(this.raw=t._element));var l=null!=i?""+i:"";this.text=l.split(/\r\n|\r|\n/g)}return t.prototype.getContentHeight=function(t){return(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/t.scaleFactor()*o.FONT_ROW_RATIO)+this.padding("vertical")},t.prototype.padding=function(t){var e=i.marginOrPadding(this.styles.cellPadding,0);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},t}();e.Cell=s;var u=function(){function t(t,e,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=n}return t.prototype.getMaxCustomCellWidth=function(t){for(var e=0,n=0,o=t.allRows();n<o.length;n++){var r=o[n].cells[this.index];r&&"number"==typeof r.styles.cellWidth&&(e=Math.max(e,r.styles.cellWidth))}return e},t}();e.Column=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8);function r(t){o.default(t)}e.applyPlugin=r;try{r(n(16))}catch(t){}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),r=n(3),i=n(10),l=n(4);e.default=function(t){t.API.autoTable=i.autoTable,t.API.lastAutoTable=!1,t.API.previousAutoTable=!1,t.API.autoTable.previous=!1,t.API.autoTableText=function(t,e,n,o){r.default(t,e,n,o,this)},t.API.autoTableSetDefaults=function(t){return l.DocHandler.setDefaults(t,this),this},t.autoTableSetDefaults=function(t,e){l.DocHandler.setDefaults(t,e)},t.API.autoTableHtmlToJson=function(t,e){if(void 0===e&&(e=!1),"undefined"==typeof window)return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;if(!(t&&t instanceof HTMLTableElement))return console.error("An HTMLTableElement has to be sent to autoTableHtmlToJson"),null;var n=o.parseHtml(this,t,window,e,!1),r=n.head,i=n.body,l=n.foot;return{columns:r[0]||i[0]||l[0],rows:i,data:i}},t.API.autoTableEndPosY=function(){console.error("Use of deprecated function: autoTableEndPosY. Use doc.previousAutoTable.finalY instead.");var t=this.previousAutoTable;return t.cursor&&"number"==typeof t.cursor.y?t.cursor.y:0},t.API.autoTableAddPageContent=function(e){return console.error("Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead."),t.API.autoTable.globalDefaults||(t.API.autoTable.globalDefaults={}),t.API.autoTable.globalDefaults.addPageContent=e,this},t.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0);function r(t,e){var n=function t(e,n){var o=n(e);return"rgba(0, 0, 0, 0)"===o||"transparent"===o||"initial"===o||"inherit"===o?null==e.parentElement?null:t(e.parentElement,n):o}(t,e);if(!n)return null;var o=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!o||!Array.isArray(o))return null;var r=[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])];return 0===parseInt(o[4])||isNaN(r[0])||isNaN(r[1])||isNaN(r[2])?null:r}e.parseCss=function(t,e,n,i,l){var a={},s=r(e,(function(t){return l.getComputedStyle(t).backgroundColor}));null!=s&&(a.fillColor=s),null!=(s=r(e,(function(t){return l.getComputedStyle(t).color})))&&(a.textColor=s),null!=(s=r(e,(function(t){return l.getComputedStyle(t).borderTopColor})))&&(a.lineColor=s);var u=function(t,e){var n=[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft],r=96/(72/e),i=(parseInt(t.lineHeight)-parseInt(t.fontSize))/e/2,l=n.map((function(t){return parseInt(t)/r})),a=o.marginOrPadding(l,0);i>a.top&&(a.top=i);i>a.bottom&&(a.bottom=i);return a}(i,n);u&&(a.cellPadding=u);var d=parseInt(i.borderTopWidth||"");(d=d/(96/72)/n)&&(a.lineWidth=d);var h=["left","right","center","justify"];-1!==h.indexOf(i.textAlign)&&(a.halign=i.textAlign),-1!==(h=["middle","bottom","top"]).indexOf(i.verticalAlign)&&(a.valign=i.verticalAlign);var c=parseInt(i.fontSize||"");isNaN(c)||(a.fontSize=c/(96/72));var f=function(t){var e="";("bold"===t.fontWeight||"bolder"===t.fontWeight||parseInt(t.fontWeight)>=700)&&(e="bold");"italic"!==t.fontStyle&&"oblique"!==t.fontStyle||(e+="italic");return e}(i);f&&(a.fontStyle=f);var g=(i.fontFamily||"").toLowerCase();return-1!==t.indexOf(g)&&(a.font=g),a}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),r=n(11),i=n(14),l=n(15);e.autoTable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,a=new o.DocHandler(this);"undefined"!=typeof window&&(n=window);var s=r.parseInput(t,a,n);return i.calculateWidths(s,a),l.drawTable(s,a),s.finalY=s.cursor.y,this.previousAutoTable=s,this.lastAutoTable=s,this.autoTable.previous=s,a.applyStyles(a.userStyles),this}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(2),i=n(5),l=n(0),a=n(12),s=n(6);function u(t,e,n,o,r,i,l){var a={};if(0===e.length&&n.columns&&"body"!==t){var u=function(t,e){var n={};return t.forEach((function(t){var o=t.raw;"head"===e&&(null==o?void 0:o.header)?n[t.dataKey]=o.header:"foot"===e&&(null==o?void 0:o.footer)&&(n[t.dataKey]=o.footer)})),Object.keys(n).length>0?n:null}(o,t);u&&e.push(u)}return e.map((function(e,n){for(var u=0,h=new s.Row(e,n,t),c=0,f=0,g=0,p=o;g<p.length;g++){var y=p[g];if(null==a[y.index]||0===a[y.index].left)if(0===f){var v=void 0,m={};"object"!=typeof(v=Array.isArray(e)?e[y.index-c-u]:e[y.dataKey])||Array.isArray(v)||(m=(null==v?void 0:v.styles)||{});var b=d(t,y,n,i,r,l,m),w=new s.Cell(v,b,t);h.cells[y.dataKey]=w,h.cells[y.index]=w,f=w.colSpan-1,a[y.index]={left:w.rowSpan-1,times:f}}else f--,c++;else a[y.index].left--,f=a[y.index].times,u++}return h}))}function d(t,e,n,r,l,a,s){var u,d=o.getTheme(r);"head"===t?u=l.headStyles:"body"===t?u=l.bodyStyles:"foot"===t&&(u=l.footStyles);var h=i.assign({},d.table,d[t],l.styles,u),c=l.columnStyles[e.dataKey]||l.columnStyles[e.index]||{},f="body"===t?c:{},g="body"===t&&n%2==0?i.assign({},d.alternateRow,l.alternateRowStyles):{},p=o.defaultStyles(a),y=i.assign({},p,h,g,f);return i.assign(y,s)}e.parseInput=function(t,e,n){var o=function(t){if(1===t.length)return t[0];var e=t[2]||{};return e.body=t[1],e.columns=t[0],e.columns.forEach((function(t){"object"==typeof t&&null==t.header&&(t.header=t.title)})),e}(t),d=e.getDocumentOptions(),h=e.getGlobalOptions();a.default(h,d,o,e);var c=i.assign({},h,d,o),f=e.getPreviousAutoTable(),g=e.scaleFactor(),p=l.marginOrPadding(c.margin,40/g),y=function(t,e,n,o){var r,i,l,a,s,u,d,h,c,f,g;f=!0===t.showFoot?"everyPage":!1===t.showFoot?"never":null!==(r=t.showFoot)&&void 0!==r?r:"everyPage";g=!0===t.showHead?"everyPage":!1===t.showHead?"never":null!==(i=t.showHead)&&void 0!==i?i:"everyPage";var p=null!==(l=t.useCss)&&void 0!==l&&l,y=t.theme||(p?"plain":"striped");return{includeHiddenHtml:null!==(a=t.includeHiddenHtml)&&void 0!==a&&a,useCss:p,theme:y,startY:n,margin:o,pageBreak:null!==(s=t.pageBreak)&&void 0!==s?s:"auto",rowPageBreak:null!==(u=t.rowPageBreak)&&void 0!==u?u:"auto",tableWidth:null!==(d=t.tableWidth)&&void 0!==d?d:"auto",showHead:g,showFoot:f,tableLineWidth:null!==(h=t.tableLineWidth)&&void 0!==h?h:0,tableLineColor:null!==(c=t.tableLineColor)&&void 0!==c?c:200}}(c,0,function(t,e,n,o,r){var i=!1;if(t){var l=t.startPageNumber+t.pageNumber-1;i=l===n}var a=o.startY;null!=a&&!1!==a||i&&(a=t.finalY+20/e);return a||r}(f,g,e.pageNumber(),c,p.top),p),v=function(t,e,n){for(var o={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},r=function(r){if("columnStyles"===r){var l=t[r],a=e[r],s=n[r];o.columnStyles=i.assign({},l,a,s)}else{var u=[t,e,n].map((function(t){return t[r]||{}}));o[r]=i.assign({},u[0],u[1],u[2])}},l=0,a=Object.keys(o);l<a.length;l++){var s=a[l];r(s)}return o}(h,d,o),m=function(t,e,n,o,i,l){var a=e.head||[],d=e.body||[],h=e.foot||[];if(e.html){var c=e.includeHiddenHtml;if(l){var f=r.parseHtml(t,e.html,l,c,e.useCss)||{};a=f.head||a,d=f.body||a,h=f.foot||a}else console.error("Cannot parse html in non browser environment")}var g=function(t,e,n,o){if(t.columns)return t.columns.map((function(t,e){var n=t.dataKey||t.key||e;return new s.Column(n,t,e)}));var r=e[0]||n[0]||o[0]||[],i=[];return Object.keys(r).filter((function(t){return"_element"!==t})).forEach((function(t){var e,n=1;"object"!=typeof(e=Array.isArray(r)?r[parseInt(t)]:r[t])||Array.isArray(e)||(n=(null==e?void 0:e.colSpan)||1);for(var o=0;o<n;o++){var l=void 0;l=Array.isArray(r)?i.length:t+(o>0?"_"+o:""),i.push(new s.Column(l,null,i.length))}})),i}(e,a,d,h);return{columns:g,head:u("head",a,e,g,n,o,i),body:u("body",d,e,g,n,o,i),foot:u("foot",h,e,g,n,o,i)}}(e,c,v,y.theme,g,n),b=new s.Table(o.tableId,y,v,function(t,e,n){for(var o={didParseCell:[],willDrawCell:[],didDrawCell:[],didDrawPage:[]},r=0,i=[t,e,n];r<i.length;r++){var l=i[r];l.didParseCell&&o.didParseCell.push(l.didParseCell),l.willDrawCell&&o.willDrawCell.push(l.willDrawCell),l.didDrawCell&&o.didDrawCell.push(l.didDrawCell),l.didDrawPage&&o.didDrawPage.push(l.didDrawPage)}return o}(h,d,o),m);return function(t,e,n){t.allRows().forEach((function(o){for(var r=0,i=t.columns;r<i.length;r++){var a=i[r],s=o.cells[a.index];if(s){t.callCellHooks(n,t.hooks.didParseCell,s,o,a);var u=s.padding("horizontal");s.contentWidth=l.getStringWidth(s.text,s.styles,n)+u;var d=l.getStringWidth(s.text.join(" ").split(/\s+/),s.styles,n);if(s.minReadableWidth=d+s.padding("horizontal"),"number"==typeof s.styles.cellWidth)s.minWidth=s.styles.cellWidth,s.wrappedWidth=s.styles.cellWidth;else if("wrap"===s.styles.cellWidth)s.minWidth=s.contentWidth,s.wrappedWidth=s.contentWidth;else{var h=10/e;s.minWidth=s.styles.minCellWidth||h,s.wrappedWidth=s.contentWidth,s.minWidth>s.wrappedWidth&&(s.wrappedWidth=s.minWidth)}}}})),t.allRows().forEach((function(e){for(var n=0,o=t.columns;n<o.length;n++){var r=o[n],i=e.cells[r.index];if(i&&1===i.colSpan)r.wrappedWidth=Math.max(r.wrappedWidth,i.wrappedWidth),r.minWidth=Math.max(r.minWidth,i.minWidth),r.minReadableWidth=Math.max(r.minReadableWidth,i.minReadableWidth);else{var l=(t.styles.columnStyles[r.dataKey]||t.styles.columnStyles[r.index]||{}).cellWidth;l&&"number"==typeof l&&(r.minWidth=l,r.wrappedWidth=l)}i&&(i.colSpan>1&&!r.minWidth&&(r.minWidth=i.minWidth),i.colSpan>1&&!r.wrappedWidth&&(r.wrappedWidth=i.minWidth))}}))}(b,g,e),b.minWidth=b.columns.reduce((function(t,e){return t+e.minWidth}),0),b.wrappedWidth=b.columns.reduce((function(t,e){return t+e.wrappedWidth}),0),"number"==typeof b.settings.tableWidth?b.width=b.settings.tableWidth:"wrap"===b.settings.tableWidth?b.width=b.wrappedWidth:b.width=e.pageSize().width-p.left-p.right,b}},function(t,e,n){"use strict";function o(t){t.rowHeight?(console.error("Use of deprecated style rowHeight. It is renamed to minCellHeight."),t.minCellHeight||(t.minCellHeight=t.rowHeight)):t.columnWidth&&(console.error("Use of deprecated style columnWidth. It is renamed to cellWidth."),t.cellWidth||(t.cellWidth=t.columnWidth))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,r){for(var i=function(t){t&&"object"!=typeof t&&console.error("The options parameter should be of type object, is: "+typeof t),void 0!==t.extendWidth&&(t.tableWidth=t.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),void 0!==t.margins&&(void 0===t.margin&&(t.margin=t.margins),console.error("Use of deprecated option: margins, use margin instead.")),t.startY&&"number"!=typeof t.startY&&(console.error("Invalid value for startY option",t.startY),delete t.startY),!t.didDrawPage&&(t.afterPageContent||t.beforePageContent||t.afterPageAdd)&&(console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead"),t.didDrawPage=function(e){r.applyStyles(r.userStyles),t.beforePageContent&&t.beforePageContent(e),r.applyStyles(r.userStyles),t.afterPageContent&&t.afterPageContent(e),r.applyStyles(r.userStyles),t.afterPageAdd&&e.pageNumber>1&&e.afterPageAdd(e),r.applyStyles(r.userStyles)}),["createdHeaderCell","drawHeaderRow","drawRow","drawHeaderCell"].forEach((function(e){t[e]&&console.error('The "'+e+'" hook has changed in version 3.0, check the changelog for how to migrate.')})),[["showFoot","showFooter"],["showHead","showHeader"],["didDrawPage","addPageContent"],["didParseCell","createdCell"],["headStyles","headerStyles"]].forEach((function(e){var n=e[0],o=e[1];t[o]&&(console.error("Use of deprecated option "+o+". Use "+n+" instead"),t[n]=t[o])})),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach((function(e){var n="string"==typeof e?e:e[0],o="string"==typeof e?e:e[1];void 0!==t[n]&&(void 0===t.styles[o]&&(t.styles[o]=t[n]),console.error("Use of deprecated option: "+n+", use the style "+o+" instead."))}));for(var e=0,n=["styles","bodyStyles","headStyles","footStyles"];e<n.length;e++){o(t[n[e]]||{})}for(var i=t.columnStyles||{},l=0,a=Object.keys(i);l<a.length;l++){o(i[a[l]]||{})}},l=0,a=[t,e,n];l<a.length;l++){i(a[l])}}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t,e){this.table=t,this.pageNumber=t.pageNumber,this.pageCount=this.pageNumber,this.settings=t.settings,this.cursor=t.cursor,this.doc=e.getDocument()};e.HookData=i;var l=function(t){function e(e,n,o,r,i){var l=t.call(this,e,n)||this;return l.cell=o,l.row=r,l.column=i,l.section=r.section,l}return r(e,t),e}(i);e.CellHookData=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0);function r(t,e,n){for(var o=e,i=t.reduce((function(t,e){return t+e.wrappedWidth}),0),l=0;l<t.length;l++){var a=t[l],s=o*(a.wrappedWidth/i),u=a.width+s,d=n(a),h=u<d?d:u;e-=h-a.width,a.width=h}if(e=Math.round(1e10*e)/1e10){var c=t.filter((function(t){return!(e<0)||t.width>n(t)}));c.length&&(e=r(c,e,n))}return e}function i(t,e,n,r,i){return t.map((function(t){return function(t,e,n,r,i){var l=1e4*r.scaleFactor();if((e=Math.ceil(e*l)/l)>=o.getStringWidth(t,n,r))return t;for(;e<o.getStringWidth(t+i,n,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+i}(t,e,n,r,i)}))}e.calculateWidths=function(t,e){var n=[],o=0;t.columns.forEach((function(e){var r=e.getMaxCustomCellWidth(t);r?e.width=r:(e.width=e.wrappedWidth,n.push(e)),o+=e.width}));var l=t.width-o;l&&(l=r(n,l,(function(t){return Math.max(t.minReadableWidth,t.minWidth)}))),l&&(l=r(n,l,(function(t){return t.minWidth}))),(l=Math.abs(l))>1e-10&&(l=l<1?l:Math.round(l),console.error("Of the table content, "+l+" units width could not fit page")),function(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var o=e[n],r=null,i=0,l=0,a=0;a<t.columns.length;a++){var s=t.columns[a];if((l-=1)>1&&t.columns[a+1])i+=s.width,delete o.cells[s.index];else if(r){var u=r;delete o.cells[s.index],r=null,u.width=s.width+i}else{if(!(u=o.cells[s.index]))continue;if(l=u.colSpan,i=0,u.colSpan>1){r=u,i+=s.width;continue}u.width=s.width+i}}}(t),function(t,e){for(var n={count:0,height:0},o=0,r=t.allRows();o<r.length;o++){for(var l=r[o],a=0,s=t.columns;a<s.length;a++){var u=s[a],d=l.cells[u.index];if(d){e.applyStyles(d.styles,!0);var h=d.width-d.padding("horizontal");"linebreak"===d.styles.overflow?d.text=e.splitTextToSize(d.text,h+1/e.scaleFactor(),{fontSize:d.styles.fontSize}):"ellipsize"===d.styles.overflow?d.text=i(d.text,h,d.styles,e,"..."):"hidden"===d.styles.overflow?d.text=i(d.text,h,d.styles,e,""):"function"==typeof d.styles.overflow&&(d.text=d.styles.overflow(d.text,h)),d.contentHeight=d.getContentHeight(e),d.styles.minCellHeight>d.contentHeight&&(d.contentHeight=d.styles.minCellHeight);var c=d.contentHeight/d.rowSpan;d.rowSpan>1&&n.count*n.height<c*d.rowSpan?n={height:c,count:d.rowSpan}:n&&n.count>0&&n.height>c&&(c=n.height),c>l.height&&(l.height=c,l.maxCellHeight=c)}}n.count--}}(t,e),function(t){for(var e={},n=1,o=t.allRows(),r=0;r<o.length;r++){for(var i=o[r],l=0,a=t.columns;l<a.length;l++){var s=a[l],u=e[s.index];if(n>1)n--,delete i.cells[s.index];else if(u)u.cell.height+=i.height,u.cell.height>i.maxCellHeight&&(u.row.maxCellHeight=u.cell.height),n=u.cell.colSpan,delete i.cells[s.index],u.left--,u.left<=1&&delete e[s.index];else{var d=i.cells[s.index];if(!d)continue;if(d.height=i.height,d.rowSpan>1){var h=o.length-r,c=d.rowSpan>h?h:d.rowSpan;e[s.index]={cell:d,left:c,row:i}}}}"head"===i.section&&(t.headHeight+=i.maxCellHeight),"foot"===i.section&&(t.footHeight+=i.maxCellHeight),t.height+=i.height}}(t)},e.resizeColumns=r,e.ellipsize=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(0),i=n(6),l=n(5),a=n(3);function s(t,e,n){var r=t.styles.fontSize/n.scaleFactor()*o.FONT_ROW_RATIO,i=t.padding("vertical"),l=Math.floor((e-i)/r);return Math.max(0,l)}function u(t,e,n){t.cursor.x=t.settings.margin.left,e.y=t.cursor.y,e.x=t.cursor.x;for(var o=0,i=t.columns;o<i.length;o++){var l=i[o],s=e.cells[l.index];if(s){if(n.applyStyles(s.styles),s.x=t.cursor.x,s.y=e.y,"top"===s.styles.valign)s.textPos.y=t.cursor.y+s.padding("top");else if("bottom"===s.styles.valign)s.textPos.y=t.cursor.y+s.height-s.padding("bottom");else{var u=s.height-s.padding("vertical");s.textPos.y=t.cursor.y+u/2+s.padding("top")}if("right"===s.styles.halign)s.textPos.x=s.x+s.width-s.padding("right");else if("center"===s.styles.halign){var d=s.width-s.padding("horizontal");s.textPos.x=s.x+d/2+s.padding("left")}else s.textPos.x=s.x+s.padding("left");if(!1!==t.callCellHooks(n,t.hooks.willDrawCell,s,e,l)){var h=s.styles,c=r.getFillStyle(h.lineWidth,h.fillColor);c&&n.rect(s.x,t.cursor.y,s.width,s.height,c),a.default(s.text,s.textPos.x,s.textPos.y,{halign:s.styles.halign,valign:s.styles.valign,maxWidth:Math.ceil(s.width-s.padding("left")-s.padding("right"))},n.getDocument()),t.callCellHooks(n,t.hooks.didDrawCell,s,e,l),t.cursor.x+=l.width}else t.cursor.x+=l.width}else t.cursor.x+=l.width}t.cursor.y+=e.height}function d(t,e){e.applyStyles(e.userStyles),"everyPage"===t.settings.showFoot&&t.foot.forEach((function(n){return u(t,n,e)})),t.finalY=t.cursor.y,t.callEndPageHooks(e);var n=t.settings.margin;r.addTableBorder(t,e),h(e),t.pageNumber++,t.pageCount++,t.cursor={x:n.left,y:n.top},t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,"everyPage"===t.settings.showHead&&t.head.forEach((function(n){return u(t,n,e)}))}function h(t){var e=t.pageNumber();t.setPage(e+1),t.pageNumber()===e&&t.addPage()}e.drawTable=function(t,e){var n=t.settings,o=n.startY,a=n.margin;t.cursor={x:a.left,y:o};var c=o+a.bottom+t.headHeight+t.footHeight;"avoid"===n.pageBreak&&(c+=t.height),("always"===n.pageBreak||null!=n.startY&&c>e.pageSize().height)&&(h(e),t.cursor.y=a.top),t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,t.startPageNumber=e.pageNumber(),e.applyStyles(e.userStyles),"firstPage"!==n.showHead&&"everyPage"!==n.showHead||t.head.forEach((function(n){return u(t,n,e)})),e.applyStyles(e.userStyles),t.body.forEach((function(n,o){!function t(e,n,o,r){var a=function(t,e,n){var o=t.settings.margin.bottom,r=t.settings.showFoot;("everyPage"===r||"lastPage"===r&&e)&&(o+=t.footHeight);return n.pageSize().height-t.cursor.y-o}(e,o,r);if(n.canEntireRowFit(a))u(e,n,r);else if(function(t,e,n,o){var r=t.pageSize().height,i=o.settings.margin,l=i.top+i.bottom,a=r-l;"body"===e.section&&(a-=o.headHeight+o.footHeight);var s=e.getMinimumRowHeight(o.columns,t),u=s<n;if(s>a)return console.error("Will not be able to print row "+e.index+" correctly since it's minimum height is larger than page height"),!0;if(!u)return!1;var d=e.hasRowSpan(o.columns);if(e.maxCellHeight>a)return d&&console.error("The content of row "+e.index+" will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported."),!0;if(d)return!1;if("avoid"===o.settings.rowPageBreak)return!1;return!0}(r,n,a,e)){var h=function(t,e,n,o){var r=new i.Row(t.raw,-1,t.section);r.spansMultiplePages=!0,t.spansMultiplePages=!0,t.height=0,t.maxCellHeight=0;for(var a=0,u=n.columns;a<u.length;a++){var d=u[a];if(p=t.cells[d.index]){Array.isArray(p.text)||(p.text=[p.text]);var h=new i.Cell(p.raw,p.styles,p.section);(h=l.assign(h,p)).textPos=l.assign({},p.textPos),h.text=[];var c=s(p,e,o);p.text.length>c&&(h.text=p.text.splice(c,p.text.length)),p.contentHeight=p.getContentHeight(o),p.contentHeight>t.height&&(t.height=p.contentHeight,t.maxCellHeight=p.contentHeight),h.contentHeight=h.getContentHeight(o),h.contentHeight>r.height&&(r.height=h.contentHeight,r.maxCellHeight=h.contentHeight),r.cells[d.index]=h}}for(var f=0,g=n.columns;f<g.length;f++){var p;d=g[f];(h=r.cells[d.index])&&(h.height=r.height),(p=t.cells[d.index])&&(p.height=t.height)}return r}(n,a,e,r);u(e,n,r),d(e,r),t(e,h,o,r)}else d(e,r),t(e,n,o,r)}(t,n,o===t.body.length-1,e)})),e.applyStyles(e.userStyles),"lastPage"!==n.showFoot&&"everyPage"!==n.showFoot||t.foot.forEach((function(n){return u(t,n,e)})),r.addTableBorder(t,e),t.callEndPageHooks(e)},e.addPage=d},function(e,n){if(void 0===t){var o=new Error("Cannot find module 'undefined'");throw o.code="MODULE_NOT_FOUND",o}e.exports=t}])})); |
{ | ||
"name": "jspdf-autotable", | ||
"version": "3.4.4", | ||
"version": "3.4.5", | ||
"description": "Generate pdf tables with javascript (jsPDF plugin)", | ||
@@ -21,3 +21,10 @@ "main": "dist/jspdf.plugin.autotable.js", | ||
"devDependencies": { | ||
"@types/mocha": "^7.0.2", | ||
"@typescript-eslint/eslint-plugin": "^2.29.0", | ||
"@typescript-eslint/parser": "^2.29.0", | ||
"dts-bundle-generator": "^4.3.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"jsdom": "^16.2.2", | ||
"jspdf": "^1.5.3", | ||
@@ -38,4 +45,5 @@ "mocha": "^7.1.1", | ||
"build": "webpack --mode=production && webpack --mode=production --minified && npm run types", | ||
"test": "mocha --require ts-node/register", | ||
"format-all": "prettier --write src", | ||
"lint": "eslint . --ext .ts", | ||
"test": "mocha -r ts-node/register test/test*.ts", | ||
"format": "prettier --write src", | ||
"version": "npm test && npm run build && git add -A dist", | ||
@@ -42,0 +50,0 @@ "hosting": "git push origin master:gh-pages -f", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
139375
2328
18