/*! * * jsPDF AutoTable plugin v5.0.2 * * Copyright (c) 2025 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable * Licensed under the MIT License. * http://opensource.org/licenses/mit-license * */ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}("undefined"!=typeof globalThis?globalThis:void 0!==this?this:"undefined"!=typeof window?window:"undefined"!=typeof self?self:global,(function(){return function(){"use strict";var t={28:function(t,e){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0}),e.HtmlRowInput=void 0,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]};var i=function(t){function e(e){var n=t.call(this)||this;return n._element=e,n}return o(e,t),e}(Array);e.HtmlRowInput=i},150:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,o,i){o=o||{};var r=i.internal.scaleFactor,l=i.internal.getFontSize()/r,a=i.getLineHeightFactor?i.getLineHeightFactor():1.15,s=l*a,u="",h=1;"middle"!==o.valign&&"bottom"!==o.valign&&"center"!==o.halign&&"right"!==o.halign||(h=(u="string"==typeof t?t.split(/\r\n|\r|\n/g):t).length||1);n+=l*(2-1.15),"middle"===o.valign?n-=h/2*s:"bottom"===o.valign&&(n-=h*s);if("center"===o.halign||"right"===o.halign){var d=l;if("center"===o.halign&&(d*=.5),u&&h>=1){for(var c=0;cr?(h.minWidth=r,h.wrappedWidth=r):(h.minWidth=h.contentWidth,h.wrappedWidth=h.contentWidth);else{var g=10/n;h.minWidth=h.styles.minCellWidth||g,h.wrappedWidth=h.contentWidth,h.minWidth>h.wrappedWidth&&(h.wrappedWidth=h.minWidth)}}}})),e.allRows().forEach((function(t){for(var n=0,o=e.columns;n1&&!i.minWidth&&(i.minWidth=r.minWidth),r.colSpan>1&&!i.wrappedWidth&&(i.wrappedWidth=r.minWidth))}}))}(t,e);var n=[],l=0;e.columns.forEach((function(t){var o=t.getMaxCustomCellWidth(e);o?t.width=o:(t.width=t.wrappedWidth,n.push(t)),l+=t.width}));var a=e.getWidth(t.pageSize().width)-l;a&&(a=i(n,a,(function(t){return Math.max(t.minReadableWidth,t.minWidth)})));a&&(a=i(n,a,(function(t){return t.minWidth})));a=Math.abs(a),!e.settings.horizontalPageBreak&&a>.1/t.scaleFactor()&&(a=a<1?a:Math.round(a),console.warn("Of the table content, ".concat(a," units width could not fit page")));(function(t){for(var e=t.allRows(),n=0;n1&&t.columns[a+1])r+=s.width,delete o.cells[s.index];else if(i){var u=i;delete o.cells[s.index],i=null,u.width=s.width+r}else{if(!(u=o.cells[s.index]))continue;if(l=u.colSpan,r=0,u.colSpan>1){i=u,r+=s.width;continue}u.width=s.width+r}}})(e),function(t,e){for(var n={count:0,height:0},o=0,i=t.allRows();o1&&n.count*n.height0&&n.height>f&&(f=n.height),f>l.height&&(l.height=f)}}n.count--}}(e,t),function(t){for(var e={},n=1,o=t.allRows(),i=0;i1)n--,delete r.cells[s.index];else if(u)u.cell.height+=r.height,n=u.cell.colSpan,delete r.cells[s.index],u.left--,u.left<=1&&delete e[s.index];else{var h=r.cells[s.index];if(!h)continue;if(h.height=r.height,h.rowSpan>1){var d=o.length-i,c=h.rowSpan>d?d:h.rowSpan;e[s.index]={cell:h,left:c,row:r}}}}}(e)},e.resizeColumns=i,e.ellipsize=r;var o=n(799);function i(t,e,n){for(var o=e,r=t.reduce((function(t,e){return t+e.wrappedWidth}),0),l=0;ln(t)}));c.length&&(e=i(c,e,n))}return e}function r(t,e,n,i,r){return t.map((function(t){return function(t,e,n,i,r){var l=1e4*i.scaleFactor();if(e=Math.ceil(e*l)/l,e>=(0,o.getStringWidth)(t,n,i))return t;for(;e<(0,o.getStringWidth)(t+r,n,i)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+r}(t,e,n,i,r)}))}},176:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.assign=function(t,e,n,o,i){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),l=1;l0?"_".concat(r):"")};i.push(l)}})),i}(o,i,l);return{columns:u,head:o,body:i,foot:l}}(n,d,h);return{id:e.tableId,content:p,hooks:f,styles:c,settings:g}};var o=n(799),i=n(643),r=n(660),l=n(344),a=n(176)},376:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.createTable=function(t,e){var n=new i.DocHandler(t),o=function(t,e){var n=t.content,o=function(t){return t.map((function(t,e){var n,o;return o="object"==typeof t&&null!==(n=t.dataKey)&&void 0!==n?n:e,new r.Column(o,t,e)}))}(n.columns);if(0===n.head.length){(i=u(o,"head"))&&n.head.push(i)}if(0===n.foot.length){var i;(i=u(o,"foot"))&&n.foot.push(i)}var l=t.settings.theme,a=t.styles;return{columns:o,head:s("head",n.head,o,a,l,e),body:s("body",n.body,o,a,l,e),foot:s("foot",n.foot,o,a,l,e)}}(e,n.scaleFactor()),l=new r.Table(e,o);return(0,a.calculateWidths)(n,l),n.applyStyles(n.userStyles),l};var o=n(28),i=n(643),r=n(524),l=n(176),a=n(152);function s(t,e,n,o,i,l){var a={};return e.map((function(e,s){for(var u=0,d={},c=0,f=0,g=0,p=n;g0?n:null}function h(t,e,n,i,r,a,s){var u,h=(0,o.getTheme)(i);"head"===t?u=r.headStyles:"body"===t?u=r.bodyStyles:"foot"===t&&(u=r.footStyles);var d=(0,l.assign)({},h.table,h[t],r.styles,u),c=r.columnStyles[e.dataKey]||r.columnStyles[e.index]||{},f="body"===t?c:{},g="body"===t&&n%2==0?(0,l.assign)({},h.alternateRow,r.alternateRowStyles):{},p=(0,o.defaultStyles)(a),y=(0,l.assign)({},p,d,g,f);return(0,l.assign)(y,s)}},460:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseCss=function(t,e,n,r,l){var a={},s=96/72,u=i(e,(function(t){return l.getComputedStyle(t).backgroundColor}));null!=u&&(a.fillColor=u);var h=i(e,(function(t){return l.getComputedStyle(t).color}));null!=h&&(a.textColor=h);var d=function(t,e){var n=[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft],i=96/(72/e),r=(parseInt(t.lineHeight)-parseInt(t.fontSize))/e/2,l=n.map((function(t){return parseInt(t||"0")/i})),a=(0,o.parseSpacing)(l,0);r>a.top&&(a.top=r);r>a.bottom&&(a.bottom=r);return a}(r,n);d&&(a.cellPadding=d);var c="borderTopColor",f=s*n,g=r.borderTopWidth;if(r.borderBottomWidth===g&&r.borderRightWidth===g&&r.borderLeftWidth===g){var p=(parseFloat(g)||0)/f;p&&(a.lineWidth=p)}else a.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/f,right:(parseFloat(r.borderRightWidth)||0)/f,bottom:(parseFloat(r.borderBottomWidth)||0)/f,left:(parseFloat(r.borderLeftWidth)||0)/f},a.lineWidth.top||(a.lineWidth.right?c="borderRightColor":a.lineWidth.bottom?c="borderBottomColor":a.lineWidth.left&&(c="borderLeftColor"));var y=i(e,(function(t){return l.getComputedStyle(t)[c]}));null!=y&&(a.lineColor=y);var v=["left","right","center","justify"];-1!==v.indexOf(r.textAlign)&&(a.halign=r.textAlign);-1!==(v=["middle","bottom","top"]).indexOf(r.verticalAlign)&&(a.valign=r.verticalAlign);var m=parseInt(r.fontSize||"");isNaN(m)||(a.fontSize=m/s);var b=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}(r);b&&(a.fontStyle=b);var w=(r.fontFamily||"").toLowerCase();-1!==t.indexOf(w)&&(a.font=w);return a};var o=n(799);function i(t,e){var n=r(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 i=[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])];return 0===parseInt(o[4])||isNaN(i[0])||isNaN(i[1])||isNaN(i[2])?null:i}function r(t,e){var n=e(t);return"rgba(0, 0, 0, 0)"===n||"transparent"===n||"initial"===n||"inherit"===n?null==t.parentElement?null:r(t.parentElement,e):n}},524:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Column=e.Cell=e.Row=e.Table=void 0;var o=n(799),i=n(28),r=n(601),l=function(){function t(t,e){this.pageNumber=1,this.id=t.id,this.settings=t.settings,this.styles=t.styles,this.hooks=t.hooks,this.columns=e.columns,this.head=e.head,this.body=e.body,this.foot=e.foot}return t.prototype.getHeadHeight=function(t){return this.head.reduce((function(e,n){return e+n.getMaxCellHeight(t)}),0)},t.prototype.getFootHeight=function(t){return this.foot.reduce((function(e,n){return e+n.getMaxCellHeight(t)}),0)},t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(t,e,n,o,i,l){for(var a=0,s=e;a1})).length>0},t.prototype.canEntireRowFit=function(t,e){return this.getMaxCellHeight(e)<=t},t.prototype.getMinimumRowHeight=function(t,e){var n=this;return t.reduce((function(t,o){var i=n.cells[o.index];if(!i)return 0;var r=e.getLineHeight(i.styles.fontSize),l=i.padding("vertical")+r;return l>t?l:t}),0)},t}();e.Row=a;var s=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.x=0,this.y=0,this.styles=e,this.section=n,this.raw=t;var i=t;null==t||"object"!=typeof t||Array.isArray(t)?(this.rowSpan=1,this.colSpan=1):(this.rowSpan=t.rowSpan||1,this.colSpan=t.colSpan||1,i=null!==(o=t.content)&&void 0!==o?o:t,t._element&&(this.raw=t._element));var r=null!=i?""+i:"";this.text=r.split(/\r\n|\r|\n/g)}return t.prototype.getTextPos=function(){var t,e;if("top"===this.styles.valign)t=this.y+this.padding("top");else if("bottom"===this.styles.valign)t=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");t=this.y+n/2+this.padding("top")}if("right"===this.styles.halign)e=this.x+this.width-this.padding("right");else if("center"===this.styles.halign){var o=this.width-this.padding("horizontal");e=this.x+o/2+this.padding("left")}else e=this.x+this.padding("left");return{x:e,y:t}},t.prototype.getContentHeight=function(t,e){void 0===e&&(e=1.15);var n=(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/t*e)+this.padding("vertical");return Math.max(n,this.styles.minCellHeight)},t.prototype.padding=function(t){var e=(0,o.parseSpacing)(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=c))break;h=!1,a.push(d),s.push(e.columns[d]),r-=c,d++}return{colIndexes:a,columns:s,lastIndex:d-1}}},639:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.applyPlugin=function(t){t.API.autoTable=function(){for(var t=[],e=0;e0&&(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(//).map((function(t){return t.trim()})).join("\n"),e.innerText||e.textContent||""}},789:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.drawTable=function(t,e){var n=e.settings,o=n.startY,l=n.margin,c={x:l.left,y:o},p=e.getHeadHeight(e.columns)+e.getFootHeight(e.columns),y=o+l.bottom+p;if("avoid"===n.pageBreak){y+=e.body.reduce((function(t,e){return t+e.height}),0)}var b=new r.DocHandler(t);("always"===n.pageBreak||null!=n.startY&&y>b.pageSize().height)&&(m(b),c.y=l.top);e.callWillDrawPageHooks(b,c);var w=(0,a.assign)({},c);e.startPageNumber=b.pageNumber(),n.horizontalPageBreak?function(t,e,n,o){var i=(0,s.calculateAllColumnsCanFitInPage)(t,e),r=e.settings;if("afterAllRows"===r.horizontalPageBreakBehaviour)i.forEach((function(i,r){t.applyStyles(t.userStyles),r>0?v(t,e,n,o,i.columns,!0):u(t,e,o,i.columns),function(t,e,n,o,i){t.applyStyles(t.userStyles),e.body.forEach((function(r,l){var a=l===e.body.length-1;f(t,e,r,a,n,o,i)}))}(t,e,n,o,i.columns),d(t,e,o,i.columns)}));else for(var l=-1,a=i[0],c=function(){var r=l;if(a){t.applyStyles(t.userStyles);var s=a.columns;l>=0?v(t,e,n,o,s,!0):u(t,e,o,s),r=h(t,e,l+1,o,s),d(t,e,o,s)}var c=r-l;i.slice(1).forEach((function(i){t.applyStyles(t.userStyles),v(t,e,n,o,i.columns,!0),h(t,e,l+1,o,i.columns,c),d(t,e,o,i.columns)})),l=r};ll)return console.error("Will not be able to print row ".concat(e.index," correctly since it's minimum height is larger than page height")),!0;if(!s)return!1;var u=e.hasRowSpan(o.columns);return e.getMaxCellHeight(o.columns)>l?(u&&console.error("The content of row ".concat(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):!u&&"avoid"!==o.settings.rowPageBreak}(t,n,u,e)){var h=function(t,e,n,o){var i={};t.spansMultiplePages=!0,t.height=0;for(var r=0,s=0,u=n.columns;sf&&(d.text=b.text.splice(f,b.text.length));var g=o.scaleFactor(),p=o.getLineHeightFactor();b.contentHeight=b.getContentHeight(g,p),b.contentHeight>=e&&(b.contentHeight=e,d.styles.minCellHeight-=e),b.contentHeight>t.height&&(t.height=b.contentHeight),d.contentHeight=d.getContentHeight(g,p),d.contentHeight>r&&(r=d.contentHeight),i[h.index]=d}}var y=new l.Row(t.raw,-1,t.section,i,!0);y.height=r;for(var v=0,m=n.columns;v0,o=e||0===e;return n&&o?"DF":n?"S":o?"F":null}function o(t,e){var n,o,i,r;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!==(i=t.right)&&void 0!==i?i:e,bottom:null!==(r=t.bottom)&&void 0!==r?r:e}):("number"!=typeof t&&(t=e),{top:t,right:t,bottom:t,left:t})}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,o,i){var r=e.settings.tableLineWidth,l=e.settings.tableLineColor;t.applyStyles({lineWidth:r,lineColor:l});var a=n(r,!1);a&&t.rect(o.x,o.y,e.getWidth(t.pageSize().width),i.y-o.y,a)},e.getFillStyle=n,e.parseSpacing=o,e.getPageAvailableWidth=function(t,e){var n=o(e.settings.margin,0);return t.pageSize().width-(n.left+n.right)}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}var o={};return function(){var t,e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.Table=e.Row=e.HookData=e.Column=e.CellHookData=e.Cell=e.applyPlugin=void 0,e.autoTable=h,e.__createTable=function(t,e){var n=(0,l.parseInput)(t,e);return(0,s.createTable)(t,n)},e.__drawTable=function(t,e){(0,u.drawTable)(t,e)};var i=n(639);Object.defineProperty(e,"applyPlugin",{enumerable:!0,get:function(){return i.applyPlugin}});var r=n(601);Object.defineProperty(e,"CellHookData",{enumerable:!0,get:function(){return r.CellHookData}}),Object.defineProperty(e,"HookData",{enumerable:!0,get:function(){return r.HookData}});var l=n(371),a=n(524);Object.defineProperty(e,"Cell",{enumerable:!0,get:function(){return a.Cell}}),Object.defineProperty(e,"Column",{enumerable:!0,get:function(){return a.Column}}),Object.defineProperty(e,"Row",{enumerable:!0,get:function(){return a.Row}}),Object.defineProperty(e,"Table",{enumerable:!0,get:function(){return a.Table}});var s=n(376),u=n(789);function h(t,e){var n=(0,l.parseInput)(t,e),o=(0,s.createTable)(t,n);(0,u.drawTable)(t,o)}try{if("undefined"!=typeof window&&window){var d=window,c=d.jsPDF||(null===(t=d.jspdf)||void 0===t?void 0:t.jsPDF);c&&(0,i.applyPlugin)(c)}}catch(t){console.error("Could not apply autoTable plugin",t)}e.default=h}(),o}()}));