@meyicloud/meyi-cost-ui 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +259 -0
- package/dist/CostPage.d.ts +12 -0
- package/dist/api.d.ts +3 -0
- package/dist/components/cost-line-chart.d.ts +13 -0
- package/dist/components/cur-readiness.d.ts +5 -0
- package/dist/components/stacked-cost-trend.d.ts +6 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/features/analysis/components/analysis-results.d.ts +4 -0
- package/dist/features/analysis/hooks/use-cost-analysis.d.ts +21 -0
- package/dist/features/analysis/index.d.ts +1 -0
- package/dist/features/budgets/components/budget-form.d.ts +12 -0
- package/dist/features/budgets/components/budget-list.d.ts +7 -0
- package/dist/features/budgets/hooks/use-cost-budgets.d.ts +21 -0
- package/dist/features/budgets/index.d.ts +1 -0
- package/dist/features/cur-discovery/index.d.ts +1 -0
- package/dist/features/overview/components/breakdown-bar-chart.d.ts +6 -0
- package/dist/features/overview/components/overview-widgets.d.ts +14 -0
- package/dist/features/overview/hooks/use-cost-overview.d.ts +16 -0
- package/dist/features/overview/index.d.ts +1 -0
- package/dist/features/reports/components/comparison-overview.d.ts +5 -0
- package/dist/features/reports/components/report-common.d.ts +15 -0
- package/dist/features/reports/components/report-sidebar.d.ts +32 -0
- package/dist/features/reports/components/report-tables.d.ts +12 -0
- package/dist/features/reports/hooks/use-cost-reports.d.ts +36 -0
- package/dist/features/reports/index.d.ts +1 -0
- package/dist/features/reports/report-export.d.ts +15 -0
- package/dist/features/reports/report-model.d.ts +49 -0
- package/dist/features/sources/index.d.ts +1 -0
- package/dist/html2canvas.esm-B5qzocYs.cjs +5 -0
- package/dist/html2canvas.esm-BWVIUcAF.js +4802 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.es-CUlzdq_P.cjs +5 -0
- package/dist/index.es-GAd5Tgul.js +6682 -0
- package/dist/index.js +21 -0
- package/dist/index.mjs +11453 -0
- package/dist/jspdf.es.min-6LRJ71fx.js +9860 -0
- package/dist/jspdf.es.min-C10id8ME.cjs +78 -0
- package/dist/jspdf.plugin.autotable-CogKBV4l.js +1087 -0
- package/dist/jspdf.plugin.autotable-CvTok6mL.cjs +2 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/purify.es-BrrCv_hE.js +864 -0
- package/dist/purify.es-DCvfCVUO.cjs +3 -0
- package/dist/router.d.ts +2 -0
- package/dist/services/cost.d.ts +57 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +217 -0
- package/package.json +66 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function J(e,t,i,r,n){r=r||{};var a=1.15,s=n.internal.scaleFactor,h=n.internal.getFontSize()/s,f=n.getLineHeightFactor?n.getLineHeightFactor():a,o=h*f,l=/\r\n|\r|\n/g,g="",u=1;if((r.valign==="middle"||r.valign==="bottom"||r.halign==="center"||r.halign==="right")&&(g=typeof e=="string"?e.split(l):e,u=g.length||1),i+=h*(2-a),r.valign==="middle"?i-=u/2*o:r.valign==="bottom"&&(i-=u*o),r.halign==="center"||r.halign==="right"){var v=h;if(r.halign==="center"&&(v*=.5),g&&u>=1){for(var d=0;d<g.length;d++)n.text(g[d],t-n.getStringUnitWidth(g[d])*v,i),i+=o;return n}t-=n.getStringUnitWidth(e)*v}return r.halign==="justify"?n.text(e,t,i,{maxWidth:r.maxWidth||100,align:"justify"}):n.text(e,t,i),n}var O={},x=(function(){function e(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,lineWidth:t.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:t.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return e.setDefaults=function(t,i){i===void 0&&(i=null),i?i.__autoTableDocumentDefaults=t:O=t},e.unifyColor=function(t){return Array.isArray(t)?t:typeof t=="number"?[t,t,t]:typeof t=="string"?[t]:null},e.prototype.applyStyles=function(t,i){var r,n,a;i===void 0&&(i=!1),t.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(t.fontStyle);var s=this.jsPDFDocument.internal.getFont(),h=s.fontStyle,f=s.fontName;if(t.font&&(f=t.font),t.fontStyle){h=t.fontStyle;var o=this.getFontList()[f];o&&o.indexOf(h)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(o[0]),h=o[0])}if(this.jsPDFDocument.setFont(f,h),t.fontSize&&this.jsPDFDocument.setFontSize(t.fontSize),!i){var l=e.unifyColor(t.fillColor);l&&(r=this.jsPDFDocument).setFillColor.apply(r,l),l=e.unifyColor(t.textColor),l&&(n=this.jsPDFDocument).setTextColor.apply(n,l),l=e.unifyColor(t.lineColor),l&&(a=this.jsPDFDocument).setDrawColor.apply(a,l),typeof t.lineWidth=="number"&&this.jsPDFDocument.setLineWidth(t.lineWidth)}},e.prototype.splitTextToSize=function(t,i,r){return this.jsPDFDocument.splitTextToSize(t,i,r)},e.prototype.rect=function(t,i,r,n,a){return this.jsPDFDocument.rect(t,i,r,n,a)},e.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},e.prototype.getTextWidth=function(t){return this.jsPDFDocument.getTextWidth(t)},e.prototype.getDocument=function(){return this.jsPDFDocument},e.prototype.setPage=function(t){this.jsPDFDocument.setPage(t)},e.prototype.addPage=function(){return this.jsPDFDocument.addPage()},e.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},e.prototype.getGlobalOptions=function(){return O||{}},e.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},e.prototype.pageSize=function(){var t=this.jsPDFDocument.internal.pageSize;return t.width==null&&(t={width:t.getWidth(),height:t.getHeight()}),t},e.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},e.prototype.getLineHeightFactor=function(){var t=this.jsPDFDocument;return t.getLineHeightFactor?t.getLineHeightFactor():1.15},e.prototype.getLineHeight=function(t){return t/this.scaleFactor()*this.getLineHeightFactor()},e.prototype.pageNumber=function(){var t=this.jsPDFDocument.internal.getCurrentPageInfo();return t?t.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},e})(),A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i[n]=r[n])},A(e,t)};function U(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");A(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}var $=(function(e){U(t,e);function t(i){var r=e.call(this)||this;return r._element=i,r}return t})(Array);function ft(e){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/e,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}function lt(e){var t={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"}}};return t[e]}function D(e,t,i){i.applyStyles(t,!0);var r=Array.isArray(e)?e:[e],n=r.map(function(a){return i.getTextWidth(a)}).reduce(function(a,s){return Math.max(a,s)},0);return n}function Q(e,t,i,r){var n=t.settings.tableLineWidth,a=t.settings.tableLineColor;e.applyStyles({lineWidth:n,lineColor:a});var s=X(n,!1);s&&e.rect(i.x,i.y,t.getWidth(e.pageSize().width),r.y-i.y,s)}function X(e,t){var i=e>0,r=t||t===0;return i&&r?"DF":i?"S":r?"F":null}function F(e,t){var i,r,n,a;if(e=e||t,Array.isArray(e)){if(e.length>=4)return{top:e[0],right:e[1],bottom:e[2],left:e[3]};if(e.length===3)return{top:e[0],right:e[1],bottom:e[2],left:e[1]};if(e.length===2)return{top:e[0],right:e[1],bottom:e[0],left:e[1]};e.length===1?e=e[0]:e=t}return typeof e=="object"?(typeof e.vertical=="number"&&(e.top=e.vertical,e.bottom=e.vertical),typeof e.horizontal=="number"&&(e.right=e.horizontal,e.left=e.horizontal),{left:(i=e.left)!==null&&i!==void 0?i:t,top:(r=e.top)!==null&&r!==void 0?r:t,right:(n=e.right)!==null&&n!==void 0?n:t,bottom:(a=e.bottom)!==null&&a!==void 0?a:t}):(typeof e!="number"&&(e=t),{top:e,right:e,bottom:e,left:e})}function Z(e,t){var i=F(t.settings.margin,0);return e.pageSize().width-(i.left+i.right)}function gt(e,t,i,r,n){var a={},s=1.3333333333333333,h=k(t,function(c){return n.getComputedStyle(c).backgroundColor});h!=null&&(a.fillColor=h);var f=k(t,function(c){return n.getComputedStyle(c).color});f!=null&&(a.textColor=f);var o=vt(r,i);o&&(a.cellPadding=o);var l="borderTopColor",g=s*i,u=r.borderTopWidth;if(r.borderBottomWidth===u&&r.borderRightWidth===u&&r.borderLeftWidth===u){var v=(parseFloat(u)||0)/g;v&&(a.lineWidth=v)}else a.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/g,right:(parseFloat(r.borderRightWidth)||0)/g,bottom:(parseFloat(r.borderBottomWidth)||0)/g,left:(parseFloat(r.borderLeftWidth)||0)/g},a.lineWidth.top||(a.lineWidth.right?l="borderRightColor":a.lineWidth.bottom?l="borderBottomColor":a.lineWidth.left&&(l="borderLeftColor"));var d=k(t,function(c){return n.getComputedStyle(c)[l]});d!=null&&(a.lineColor=d);var m=["left","right","center","justify"];m.indexOf(r.textAlign)!==-1&&(a.halign=r.textAlign),m=["middle","bottom","top"],m.indexOf(r.verticalAlign)!==-1&&(a.valign=r.verticalAlign);var p=parseInt(r.fontSize||"");isNaN(p)||(a.fontSize=p/s);var y=ut(r);y&&(a.fontStyle=y);var C=(r.fontFamily||"").toLowerCase();return e.indexOf(C)!==-1&&(a.font=C),a}function ut(e){var t="";return(e.fontWeight==="bold"||e.fontWeight==="bolder"||parseInt(e.fontWeight)>=700)&&(t="bold"),(e.fontStyle==="italic"||e.fontStyle==="oblique")&&(t+="italic"),t}function k(e,t){var i=V(e,t);if(!i)return null;var r=i.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var n=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],a=parseInt(r[4]);return a===0||isNaN(n[0])||isNaN(n[1])||isNaN(n[2])?null:n}function V(e,t){var i=t(e);return i==="rgba(0, 0, 0, 0)"||i==="transparent"||i==="initial"||i==="inherit"?e.parentElement==null?null:V(e.parentElement,t):i}function vt(e,t){var i=[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft],r=96/(72/t),n=(parseInt(e.lineHeight)-parseInt(e.fontSize))/t/2,a=i.map(function(h){return parseInt(h||"0")/r}),s=F(a,0);return n>s.top&&(s.top=n),n>s.bottom&&(s.bottom=n),s}function tt(e,t,i,r,n){var a,s;r===void 0&&(r=!1),n===void 0&&(n=!1);var h;typeof t=="string"?h=i.document.querySelector(t):h=t;var f=Object.keys(e.getFontList()),o=e.scaleFactor(),l=[],g=[],u=[];if(!h)return console.error("Html table could not be found with input: ",t),{head:l,body:g,foot:u};for(var v=0;v<h.rows.length;v++){var d=h.rows[v],m=(s=(a=d?.parentElement)===null||a===void 0?void 0:a.tagName)===null||s===void 0?void 0:s.toLowerCase(),p=dt(f,o,i,d,r,n);p&&(m==="thead"?l.push(p):m==="tfoot"?u.push(p):g.push(p))}return{head:l,body:g,foot:u}}function dt(e,t,i,r,n,a){for(var s=new $(r),h=0;h<r.cells.length;h++){var f=r.cells[h],o=i.getComputedStyle(f);if(n||o.display!=="none"){var l=void 0;a&&(l=gt(e,f,t,o,i)),s.push({rowSpan:f.rowSpan,colSpan:f.colSpan,styles:l,_element:f,content:pt(f)})}}var g=i.getComputedStyle(r);if(s.length>0&&(n||g.display!=="none"))return s}function pt(e){var t=e.cloneNode(!0);return t.innerHTML=t.innerHTML.replace(/\n/g,"").replace(/ +/g," "),t.innerHTML=t.innerHTML.split(/<br.*?>/).map(function(i){return i.trim()}).join(`
|
|
2
|
+
`),t.innerText||t.textContent||""}function yt(e,t,i){for(var r=0,n=[e,t,i];r<n.length;r++){var a=n[r];a&&typeof a!="object"&&console.error("The options parameter should be of type object, is: "+typeof a),a.startY&&typeof a.startY!="number"&&(console.error("Invalid value for startY option",a.startY),delete a.startY)}}function w(e,t,i,r,n){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var a=Object(e),s=1;s<arguments.length;s++){var h=arguments[s];if(h!=null)for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(a[f]=h[f])}return a}function B(e,t){var i=new x(e),r=i.getDocumentOptions(),n=i.getGlobalOptions();yt(n,r,t);var a=w({},n,r,t),s;typeof window<"u"&&(s=window);var h=mt(n,r,t),f=ct(n,r,t),o=wt(i,a),l=Ct(i,a,s);return{id:t.tableId,content:l,hooks:f,styles:h,settings:o}}function mt(e,t,i){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},n=function(f){if(f==="columnStyles"){var o=e[f],l=t[f],g=i[f];r.columnStyles=w({},o,l,g)}else{var u=[e,t,i],v=u.map(function(d){return d[f]||{}});r[f]=w({},v[0],v[1],v[2])}},a=0,s=Object.keys(r);a<s.length;a++){var h=s[a];n(h)}return r}function ct(e,t,i){for(var r=[e,t,i],n={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},a=0,s=r;a<s.length;a++){var h=s[a];h.didParseCell&&n.didParseCell.push(h.didParseCell),h.willDrawCell&&n.willDrawCell.push(h.willDrawCell),h.didDrawCell&&n.didDrawCell.push(h.didDrawCell),h.willDrawPage&&n.willDrawPage.push(h.willDrawPage),h.didDrawPage&&n.didDrawPage.push(h.didDrawPage)}return n}function wt(e,t){var i,r,n,a,s,h,f,o,l,g,u,v,d=F(t.margin,40/e.scaleFactor()),m=(i=St(e,t.startY))!==null&&i!==void 0?i:d.top,p;t.showFoot===!0?p="everyPage":t.showFoot===!1?p="never":p=(r=t.showFoot)!==null&&r!==void 0?r:"everyPage";var y;t.showHead===!0?y="everyPage":t.showHead===!1?y="never":y=(n=t.showHead)!==null&&n!==void 0?n:"everyPage";var C=(a=t.useCss)!==null&&a!==void 0?a:!1,c=t.theme||(C?"plain":"striped"),P=!!t.horizontalPageBreak,ht=(s=t.horizontalPageBreakRepeat)!==null&&s!==void 0?s:null;return{includeHiddenHtml:(h=t.includeHiddenHtml)!==null&&h!==void 0?h:!1,useCss:C,theme:c,startY:m,margin:d,pageBreak:(f=t.pageBreak)!==null&&f!==void 0?f:"auto",rowPageBreak:(o=t.rowPageBreak)!==null&&o!==void 0?o:"auto",tableWidth:(l=t.tableWidth)!==null&&l!==void 0?l:"auto",showHead:y,showFoot:p,tableLineWidth:(g=t.tableLineWidth)!==null&&g!==void 0?g:0,tableLineColor:(u=t.tableLineColor)!==null&&u!==void 0?u:200,horizontalPageBreak:P,horizontalPageBreakRepeat:ht,horizontalPageBreakBehaviour:(v=t.horizontalPageBreakBehaviour)!==null&&v!==void 0?v:"afterAllRows"}}function St(e,t){var i=e.getLastAutoTable(),r=e.scaleFactor(),n=e.pageNumber(),a=!1;if(i&&i.startPageNumber){var s=i.startPageNumber+i.pageNumber-1;a=s===n}return typeof t=="number"?t:(t==null||t===!1)&&a&&i?.finalY!=null?i.finalY+20/r:null}function Ct(e,t,i){var r=t.head||[],n=t.body||[],a=t.foot||[];if(t.html){var s=t.includeHiddenHtml;if(i){var h=tt(e,t.html,i,s,t.useCss)||{};r=h.head||r,n=h.body||r,a=h.foot||r}else console.error("Cannot parse html in non browser environment")}var f=t.columns||Pt(r,n,a);return{columns:f,head:r,body:n,foot:a}}function Pt(e,t,i){var r=e[0]||t[0]||i[0]||[],n=[];return Object.keys(r).filter(function(a){return a!=="_element"}).forEach(function(a){var s=1,h;Array.isArray(r)?h=r[parseInt(a)]:h=r[a],typeof h=="object"&&!Array.isArray(h)&&(s=h?.colSpan||1);for(var f=0;f<s;f++){var o=void 0;Array.isArray(r)?o=n.length:o=a+(f>0?"_".concat(f):"");var l={dataKey:o};n.push(l)}}),n}var W=(function(){function e(t,i,r){this.table=i,this.pageNumber=i.pageNumber,this.settings=i.settings,this.cursor=r,this.doc=t.getDocument()}return e})(),et=(function(e){U(t,e);function t(i,r,n,a,s,h){var f=e.call(this,i,r,h)||this;return f.cell=n,f.row=a,f.column=s,f.section=a.section,f}return t})(W),rt=(function(){function e(t,i){this.pageNumber=1,this.id=t.id,this.settings=t.settings,this.styles=t.styles,this.hooks=t.hooks,this.columns=i.columns,this.head=i.head,this.body=i.body,this.foot=i.foot}return e.prototype.getHeadHeight=function(t){return this.head.reduce(function(i,r){return i+r.getMaxCellHeight(t)},0)},e.prototype.getFootHeight=function(t){return this.foot.reduce(function(i,r){return i+r.getMaxCellHeight(t)},0)},e.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},e.prototype.callCellHooks=function(t,i,r,n,a,s){for(var h=0,f=i;h<f.length;h++){var o=f[h],l=new et(t,this,r,n,a,s),g=o(l)===!1;if(r.text=Array.isArray(r.text)?r.text:[r.text],g)return!1}return!0},e.prototype.callEndPageHooks=function(t,i){t.applyStyles(t.userStyles);for(var r=0,n=this.hooks.didDrawPage;r<n.length;r++){var a=n[r];a(new W(t,this,i))}},e.prototype.callWillDrawPageHooks=function(t,i){for(var r=0,n=this.hooks.willDrawPage;r<n.length;r++){var a=n[r];a(new W(t,this,i))}},e.prototype.getWidth=function(t){if(typeof this.settings.tableWidth=="number")return this.settings.tableWidth;if(this.settings.tableWidth==="wrap"){var i=this.columns.reduce(function(n,a){return n+a.wrappedWidth},0);return i}else{var r=this.settings.margin;return t-r.left-r.right}},e})(),L=(function(){function e(t,i,r,n,a){a===void 0&&(a=!1),this.height=0,this.raw=t,t instanceof $&&(this.raw=t._element,this.element=t._element),this.index=i,this.section=r,this.cells=n,this.spansMultiplePages=a}return e.prototype.getMaxCellHeight=function(t){var i=this;return t.reduce(function(r,n){var a;return Math.max(r,((a=i.cells[n.index])===null||a===void 0?void 0:a.height)||0)},0)},e.prototype.hasRowSpan=function(t){var i=this;return t.filter(function(r){var n=i.cells[r.index];return n?n.rowSpan>1:!1}).length>0},e.prototype.canEntireRowFit=function(t,i){return this.getMaxCellHeight(i)<=t},e.prototype.getMinimumRowHeight=function(t,i){var r=this;return t.reduce(function(n,a){var s=r.cells[a.index];if(!s)return 0;var h=i.getLineHeight(s.styles.fontSize),f=s.padding("vertical"),o=f+h;return o>n?o:n},0)},e})(),E=(function(){function e(t,i,r){var n;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=i,this.section=r,this.raw=t;var a=t;t!=null&&typeof t=="object"&&!Array.isArray(t)?(this.rowSpan=t.rowSpan||1,this.colSpan=t.colSpan||1,a=(n=t.content)!==null&&n!==void 0?n:t,t._element&&(this.raw=t._element)):(this.rowSpan=1,this.colSpan=1);var s=a!=null?""+a:"",h=/\r\n|\r|\n/g;this.text=s.split(h)}return e.prototype.getTextPos=function(){var t;if(this.styles.valign==="top")t=this.y+this.padding("top");else if(this.styles.valign==="bottom")t=this.y+this.height-this.padding("bottom");else{var i=this.height-this.padding("vertical");t=this.y+i/2+this.padding("top")}var r;if(this.styles.halign==="right")r=this.x+this.width-this.padding("right");else if(this.styles.halign==="center"){var n=this.width-this.padding("horizontal");r=this.x+n/2+this.padding("left")}else r=this.x+this.padding("left");return{x:r,y:t}},e.prototype.getContentHeight=function(t,i){i===void 0&&(i=1.15);var r=Array.isArray(this.text)?this.text.length:1,n=this.styles.fontSize/t*i,a=r*n+this.padding("vertical");return Math.max(a,this.styles.minCellHeight)},e.prototype.padding=function(t){var i=F(this.styles.cellPadding,0);return t==="vertical"?i.top+i.bottom:t==="horizontal"?i.left+i.right:i[t]},e})(),it=(function(){function e(t,i,r){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=t,this.raw=i,this.index=r}return e.prototype.getMaxCustomCellWidth=function(t){for(var i=0,r=0,n=t.allRows();r<n.length;r++){var a=n[r],s=a.cells[this.index];s&&typeof s.styles.cellWidth=="number"&&(i=Math.max(i,s.styles.cellWidth))}return i},e})();function xt(e,t){Ht(e,t);var i=[],r=0;t.columns.forEach(function(a){var s=a.getMaxCustomCellWidth(t);s?a.width=s:(a.width=a.wrappedWidth,i.push(a)),r+=a.width});var n=t.getWidth(e.pageSize().width)-r;n&&(n=j(i,n,function(a){return Math.max(a.minReadableWidth,a.minWidth)})),n&&(n=j(i,n,function(a){return a.minWidth})),n=Math.abs(n),!t.settings.horizontalPageBreak&&n>.1/e.scaleFactor()&&(n=n<1?n:Math.round(n),console.log("Of the table content, ".concat(n," units width could not fit page"))),Wt(t),bt(t,e),Dt(t)}function Ht(e,t){var i=e.scaleFactor(),r=t.settings.horizontalPageBreak,n=Z(e,t);t.allRows().forEach(function(a){for(var s=0,h=t.columns;s<h.length;s++){var f=h[s],o=a.cells[f.index];if(o){var l=t.hooks.didParseCell;t.callCellHooks(e,l,o,a,f,null);var g=o.padding("horizontal");o.contentWidth=D(o.text,o.styles,e)+g;var u=D(o.text.join(" ").split(/[^\S\u00A0]+/),o.styles,e);if(o.minReadableWidth=u+o.padding("horizontal"),typeof o.styles.cellWidth=="number")o.minWidth=o.styles.cellWidth,o.wrappedWidth=o.styles.cellWidth;else if(o.styles.cellWidth==="wrap"||r===!0)o.contentWidth>n?(o.minWidth=n,o.wrappedWidth=n):(o.minWidth=o.contentWidth,o.wrappedWidth=o.contentWidth);else{var v=10/i;o.minWidth=o.styles.minCellWidth||v,o.wrappedWidth=o.contentWidth,o.minWidth>o.wrappedWidth&&(o.wrappedWidth=o.minWidth)}}}}),t.allRows().forEach(function(a){for(var s=0,h=t.columns;s<h.length;s++){var f=h[s],o=a.cells[f.index];if(o&&o.colSpan===1)f.wrappedWidth=Math.max(f.wrappedWidth,o.wrappedWidth),f.minWidth=Math.max(f.minWidth,o.minWidth),f.minReadableWidth=Math.max(f.minReadableWidth,o.minReadableWidth);else{var l=t.styles.columnStyles[f.dataKey]||t.styles.columnStyles[f.index]||{},g=l.cellWidth||l.minCellWidth;g&&typeof g=="number"&&(f.minWidth=g,f.wrappedWidth=g)}o&&(o.colSpan>1&&!f.minWidth&&(f.minWidth=o.minWidth),o.colSpan>1&&!f.wrappedWidth&&(f.wrappedWidth=o.minWidth))}})}function j(e,t,i){for(var r=t,n=e.reduce(function(v,d){return v+d.wrappedWidth},0),a=0;a<e.length;a++){var s=e[a],h=s.wrappedWidth/n,f=r*h,o=s.width+f,l=i(s),g=o<l?l:o;t-=g-s.width,s.width=g}if(t=Math.round(t*1e10)/1e10,t){var u=e.filter(function(v){return t<0?v.width>i(v):!0});u.length&&(t=j(u,t,i))}return t}function Dt(e){for(var t={},i=1,r=e.allRows(),n=0;n<r.length;n++)for(var a=r[n],s=0,h=e.columns;s<h.length;s++){var f=h[s],o=t[f.index];if(i>1)i--,delete a.cells[f.index];else if(o)o.cell.height+=a.height,i=o.cell.colSpan,delete a.cells[f.index],o.left--,o.left<=1&&delete t[f.index];else{var l=a.cells[f.index];if(!l)continue;if(l.height=a.height,l.rowSpan>1){var g=r.length-n,u=l.rowSpan>g?g:l.rowSpan;t[f.index]={cell:l,left:u,row:a}}}}}function Wt(e){for(var t=e.allRows(),i=0;i<t.length;i++)for(var r=t[i],n=null,a=0,s=0,h=0;h<e.columns.length;h++){var f=e.columns[h];if(s-=1,s>1&&e.columns[h+1])a+=f.width,delete r.cells[f.index];else if(n){var o=n;delete r.cells[f.index],n=null,o.width=f.width+a}else{var o=r.cells[f.index];if(!o)continue;if(s=o.colSpan,a=0,o.colSpan>1){n=o,a+=f.width;continue}o.width=f.width+a}}}function bt(e,t){for(var i={count:0,height:0},r=0,n=e.allRows();r<n.length;r++){for(var a=n[r],s=0,h=e.columns;s<h.length;s++){var f=h[s],o=a.cells[f.index];if(o){t.applyStyles(o.styles,!0);var l=o.width-o.padding("horizontal");if(o.styles.overflow==="linebreak")o.text=t.splitTextToSize(o.text,l+1/t.scaleFactor(),{fontSize:o.styles.fontSize});else if(o.styles.overflow==="ellipsize")o.text=Y(o.text,l,o.styles,t,"...");else if(o.styles.overflow==="hidden")o.text=Y(o.text,l,o.styles,t,"");else if(typeof o.styles.overflow=="function"){var g=o.styles.overflow(o.text,l);typeof g=="string"?o.text=[g]:o.text=g}o.contentHeight=o.getContentHeight(t.scaleFactor(),t.getLineHeightFactor());var u=o.contentHeight/o.rowSpan;o.rowSpan>1&&i.count*i.height<u*o.rowSpan?i={height:u,count:o.rowSpan}:i&&i.count>0&&i.height>u&&(u=i.height),u>a.height&&(a.height=u)}}i.count--}}function Y(e,t,i,r,n){return e.map(function(a){return Ft(a,t,i,r,n)})}function Ft(e,t,i,r,n){var a=1e4*r.scaleFactor();if(t=Math.ceil(t*a)/a,t>=D(e,i,r))return e;for(;t<D(e+n,i,r)&&!(e.length<=1);)e=e.substring(0,e.length-1);return e.trim()+n}function M(e,t){var i=new x(e),r=kt(t,i.scaleFactor()),n=new rt(t,r);return xt(i,n),i.applyStyles(i.userStyles),n}function kt(e,t){var i=e.content,r=Rt(i.columns);if(i.head.length===0){var n=_(r,"head");n&&i.head.push(n)}if(i.foot.length===0){var n=_(r,"foot");n&&i.foot.push(n)}var a=e.settings.theme,s=e.styles;return{columns:r,head:T("head",i.head,r,s,a,t),body:T("body",i.body,r,s,a,t),foot:T("foot",i.foot,r,s,a,t)}}function T(e,t,i,r,n,a){var s={},h=t.map(function(f,o){for(var l=0,g={},u=0,v=0,d=0,m=i;d<m.length;d++){var p=m[d];if(s[p.index]==null||s[p.index].left===0)if(v===0){var y=void 0;Array.isArray(f)?y=f[p.index-u-l]:y=f[p.dataKey];var C={};typeof y=="object"&&!Array.isArray(y)&&(C=y?.styles||{});var c=zt(e,p,o,n,r,a,C),P=new E(y,c,e);g[p.dataKey]=P,g[p.index]=P,v=P.colSpan-1,s[p.index]={left:P.rowSpan-1,times:v}}else v--,u++;else s[p.index].left--,v=s[p.index].times,l++}return new L(f,o,e,g)});return h}function _(e,t){var i={};return e.forEach(function(r){if(r.raw!=null){var n=Tt(t,r.raw);n!=null&&(i[r.dataKey]=n)}}),Object.keys(i).length>0?i:null}function Tt(e,t){if(e==="head"){if(typeof t=="object")return t.header||null;if(typeof t=="string"||typeof t=="number")return t}else if(e==="foot"&&typeof t=="object")return t.footer;return null}function Rt(e){return e.map(function(t,i){var r,n;return typeof t=="object"?n=(r=t.dataKey)!==null&&r!==void 0?r:i:n=i,new it(n,t,i)})}function zt(e,t,i,r,n,a,s){var h=lt(r),f;e==="head"?f=n.headStyles:e==="body"?f=n.bodyStyles:e==="foot"&&(f=n.footStyles);var o=w({},h.table,h[e],n.styles,f),l=n.columnStyles[t.dataKey]||n.columnStyles[t.index]||{},g=e==="body"?l:{},u=e==="body"&&i%2===0?w({},h.alternateRow,n.alternateRowStyles):{},v=ft(a),d=w({},v,o,u,g);return w(d,s)}function At(e,t,i){var r;i===void 0&&(i={});var n=Z(e,t),a=new Map,s=[],h=[],f=[];Array.isArray(t.settings.horizontalPageBreakRepeat)?f=t.settings.horizontalPageBreakRepeat:(typeof t.settings.horizontalPageBreakRepeat=="string"||typeof t.settings.horizontalPageBreakRepeat=="number")&&(f=[t.settings.horizontalPageBreakRepeat]),f.forEach(function(u){var v=t.columns.find(function(d){return d.dataKey===u||d.index===u});v&&!a.has(v.index)&&(a.set(v.index,!0),s.push(v.index),h.push(t.columns[v.index]),n-=v.wrappedWidth)});for(var o=!0,l=(r=i?.start)!==null&&r!==void 0?r:0;l<t.columns.length;){if(a.has(l)){l++;continue}var g=t.columns[l].wrappedWidth;if(o||n>=g)o=!1,s.push(l),h.push(t.columns[l]),n-=g;else break;l++}return{colIndexes:s,columns:h,lastIndex:l-1}}function jt(e,t){for(var i=[],r=0;r<t.columns.length;r++){var n=At(e,t,{start:r});n.columns.length&&(i.push(n),r=n.lastIndex)}return i}function N(e,t){var i=t.settings,r=i.startY,n=i.margin,a={x:n.left,y:r},s=t.getHeadHeight(t.columns)+t.getFootHeight(t.columns),h=r+n.bottom+s;if(i.pageBreak==="avoid"){var f=t.body,o=f.reduce(function(u,v){return u+v.height},0);h+=o}var l=new x(e);(i.pageBreak==="always"||i.startY!=null&&h>l.pageSize().height)&&(at(l),a.y=n.top),t.callWillDrawPageHooks(l,a);var g=w({},a);t.startPageNumber=l.pageNumber(),i.horizontalPageBreak?Bt(l,t,g,a):(l.applyStyles(l.userStyles),(i.showHead==="firstPage"||i.showHead==="everyPage")&&t.head.forEach(function(u){return S(l,t,u,a,t.columns)}),l.applyStyles(l.userStyles),t.body.forEach(function(u,v){var d=v===t.body.length-1;b(l,t,u,d,g,a,t.columns)}),l.applyStyles(l.userStyles),(i.showFoot==="lastPage"||i.showFoot==="everyPage")&&t.foot.forEach(function(u){return S(l,t,u,a,t.columns)})),Q(l,t,g,a),t.callEndPageHooks(l,a),t.finalY=a.y,e.lastAutoTable=t,l.applyStyles(l.userStyles)}function Bt(e,t,i,r){var n=jt(e,t),a=t.settings;if(a.horizontalPageBreakBehaviour==="afterAllRows")n.forEach(function(o,l){e.applyStyles(e.userStyles),l>0?H(e,t,i,r,o.columns,!0):I(e,t,r,o.columns),Lt(e,t,i,r,o.columns),R(e,t,r,o.columns)});else for(var s=-1,h=n[0],f=function(){var o=s;if(h){e.applyStyles(e.userStyles);var l=h.columns;s>=0?H(e,t,i,r,l,!0):I(e,t,r,l),o=K(e,t,s+1,r,l),R(e,t,r,l)}var g=o-s;n.slice(1).forEach(function(u){e.applyStyles(e.userStyles),H(e,t,i,r,u.columns,!0),K(e,t,s+1,r,u.columns,g),R(e,t,r,u.columns)}),s=o};s<t.body.length-1;)f()}function I(e,t,i,r){var n=t.settings;e.applyStyles(e.userStyles),(n.showHead==="firstPage"||n.showHead==="everyPage")&&t.head.forEach(function(a){return S(e,t,a,i,r)})}function Lt(e,t,i,r,n){e.applyStyles(e.userStyles),t.body.forEach(function(a,s){var h=s===t.body.length-1;b(e,t,a,h,i,r,n)})}function K(e,t,i,r,n,a){e.applyStyles(e.userStyles),a=a??t.body.length;for(var s=Math.min(i+a,t.body.length),h=-1,f=t.body.slice(i,s),o=0;o<f.length;o++){var l=f[o],g=i+o===t.body.length-1,u=nt(e,t,g,r);if(l.canEntireRowFit(u,n))S(e,t,l,r,n),h=i+o;else break}return h}function R(e,t,i,r){var n=t.settings;e.applyStyles(e.userStyles),(n.showFoot==="lastPage"||n.showFoot==="everyPage")&&t.foot.forEach(function(a){return S(e,t,a,i,r)})}function Et(e,t,i){var r=i.getLineHeight(e.styles.fontSize),n=e.padding("vertical"),a=Math.floor((t-n)/r);return Math.max(0,a)}function Mt(e,t,i,r){var n={};e.spansMultiplePages=!0,e.height=0;for(var a=0,s=0,h=i.columns;s<h.length;s++){var f=h[s],o=e.cells[f.index];if(o){Array.isArray(o.text)||(o.text=[o.text]);var l=new E(o.raw,o.styles,o.section);l=w(l,o),l.text=[];var g=Et(o,t,r);o.text.length>g&&(l.text=o.text.splice(g,o.text.length));var u=r.scaleFactor(),v=r.getLineHeightFactor();o.contentHeight=o.getContentHeight(u,v),o.contentHeight>=t&&(o.contentHeight=t,l.styles.minCellHeight-=t),o.contentHeight>e.height&&(e.height=o.contentHeight),l.contentHeight=l.getContentHeight(u,v),l.contentHeight>a&&(a=l.contentHeight),n[f.index]=l}}var d=new L(e.raw,-1,e.section,n,!0);d.height=a;for(var m=0,p=i.columns;m<p.length;m++){var f=p[m],l=d.cells[f.index];l&&(l.height=d.height);var o=e.cells[f.index];o&&(o.height=e.height)}return d}function Nt(e,t,i,r){var n=e.pageSize().height,a=r.settings.margin,s=a.top+a.bottom,h=n-s;t.section==="body"&&(h-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var f=t.getMinimumRowHeight(r.columns,e),o=f<i;if(f>h)return console.log("Will not be able to print row ".concat(t.index," correctly since it's minimum height is larger than page height")),!0;if(!o)return!1;var l=t.hasRowSpan(r.columns),g=t.getMaxCellHeight(r.columns)>h;return g?(l&&console.log("The content of row ".concat(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):!(l||r.settings.rowPageBreak==="avoid")}function b(e,t,i,r,n,a,s){var h=nt(e,t,r,a);if(i.canEntireRowFit(h,s))S(e,t,i,a,s);else if(Nt(e,i,h,t)){var f=Mt(i,h,t,e);S(e,t,i,a,s),H(e,t,n,a,s),b(e,t,f,r,n,a,s)}else H(e,t,n,a,s),b(e,t,i,r,n,a,s)}function S(e,t,i,r,n){r.x=t.settings.margin.left;for(var a=0,s=n;a<s.length;a++){var h=s[a],f=i.cells[h.index];if(!f){r.x+=h.width;continue}e.applyStyles(f.styles),f.x=r.x,f.y=r.y;var o=t.callCellHooks(e,t.hooks.willDrawCell,f,i,h,r);if(o===!1){r.x+=h.width;continue}Ot(e,f,r);var l=f.getTextPos();J(f.text,l.x,l.y,{halign:f.styles.halign,valign:f.styles.valign,maxWidth:Math.ceil(f.width-f.padding("left")-f.padding("right"))},e.getDocument()),t.callCellHooks(e,t.hooks.didDrawCell,f,i,h,r),r.x+=h.width}r.y+=i.height}function Ot(e,t,i){var r=t.styles;if(e.getDocument().setFillColor(e.getDocument().getFillColor()),typeof r.lineWidth=="number"){var n=X(r.lineWidth,r.fillColor);n&&e.rect(t.x,i.y,t.width,t.height,n)}else typeof r.lineWidth=="object"&&(r.fillColor&&e.rect(t.x,i.y,t.width,t.height,"F"),Yt(e,t,i,r.lineWidth))}function Yt(e,t,i,r){var n,a,s,h;r.top&&(n=i.x,a=i.y,s=i.x+t.width,h=i.y,r.right&&(s+=.5*r.right),r.left&&(n-=.5*r.left),f(r.top,n,a,s,h)),r.bottom&&(n=i.x,a=i.y+t.height,s=i.x+t.width,h=i.y+t.height,r.right&&(s+=.5*r.right),r.left&&(n-=.5*r.left),f(r.bottom,n,a,s,h)),r.left&&(n=i.x,a=i.y,s=i.x,h=i.y+t.height,r.top&&(a-=.5*r.top),r.bottom&&(h+=.5*r.bottom),f(r.left,n,a,s,h)),r.right&&(n=i.x+t.width,a=i.y,s=i.x+t.width,h=i.y+t.height,r.top&&(a-=.5*r.top),r.bottom&&(h+=.5*r.bottom),f(r.right,n,a,s,h));function f(o,l,g,u,v){e.getDocument().setLineWidth(o),e.getDocument().line(l,g,u,v,"S")}}function nt(e,t,i,r){var n=t.settings.margin.bottom,a=t.settings.showFoot;return(a==="everyPage"||a==="lastPage"&&i)&&(n+=t.getFootHeight(t.columns)),e.pageSize().height-r.y-n}function H(e,t,i,r,n,a){n===void 0&&(n=[]),a===void 0&&(a=!1),e.applyStyles(e.userStyles),t.settings.showFoot==="everyPage"&&!a&&t.foot.forEach(function(h){return S(e,t,h,r,n)}),t.callEndPageHooks(e,r);var s=t.settings.margin;Q(e,t,i,r),at(e),t.pageNumber++,r.x=s.left,r.y=s.top,i.y=s.top,t.callWillDrawPageHooks(e,r),t.settings.showHead==="everyPage"&&(t.head.forEach(function(h){return S(e,t,h,r,n)}),e.applyStyles(e.userStyles))}function at(e){var t=e.pageNumber();e.setPage(t+1);var i=e.pageNumber();return i===t?(e.addPage(),!0):!1}function ot(e){e.API.autoTable=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=t[0],n=B(this,r),a=M(this,n);return N(this,a),this},e.API.lastAutoTable=!1,e.API.autoTableText=function(t,i,r,n){J(t,i,r,n,this)},e.API.autoTableSetDefaults=function(t){return x.setDefaults(t,this),this},e.autoTableSetDefaults=function(t,i){x.setDefaults(t,i)},e.API.autoTableHtmlToJson=function(t,i){var r;if(i===void 0&&(i=!1),typeof window>"u")return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var n=new x(this),a=tt(n,t,window,i,!1),s=a.head,h=a.body,f=((r=s[0])===null||r===void 0?void 0:r.map(function(o){return o.content}))||[];return{columns:f,rows:h,data:h}}}var z;function st(e,t){var i=B(e,t),r=M(e,i);N(e,r)}function _t(e,t){var i=B(e,t);return M(e,i)}function It(e,t){N(e,t)}try{if(typeof window<"u"&&window){var q=window,G=q.jsPDF||((z=q.jspdf)===null||z===void 0?void 0:z.jsPDF);G&&ot(G)}}catch(e){console.error("Could not apply autoTable plugin",e)}exports.Cell=E;exports.CellHookData=et;exports.Column=it;exports.HookData=W;exports.Row=L;exports.Table=rt;exports.__createTable=_t;exports.__drawTable=It;exports.applyPlugin=ot;exports.autoTable=st;exports.default=st;
|