Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-excel-export

Package Overview
Dependencies
Maintainers
2
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-excel-export - npm Package Compare versions

Comparing version 16.3.24 to 16.3.29

src/global.js

2

CHANGELOG.md

@@ -5,2 +5,4 @@ # Changelog

## 16.3.17 (2018-09-12)
### Excel Export

@@ -7,0 +9,0 @@

4

dist/ej2-excel-export.umd.min.js
/*!
* filename: ej2-excel-export.umd.min.js
* version : 16.3.24
* version : 16.3.29
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved.

@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license.

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-compression"),require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-compression","@syncfusion/ej2-base"],t):t(e.ej={},e.ej2Compression,e.ej2Base)}(this,function(e,t,o){"use strict";var r=function(){return function(){this.numFmtId=0,this.backColor="none",this.fontName="Calibri",this.fontSize=14,this.fontColor="#000000",this.italic=!1,this.bold=!1,this.underline=!1,this.wrapText=!1,this.hAlign="general",this.vAlign="bottom",this.indent=0,this.numberFormat="GENERAL",this.type="datetime",this.borders=new p,this.isGlobalStyle=!1}}(),n=function(){return function(){this.sz=14,this.name="Calibri",this.u=!1,this.b=!1,this.i=!1,this.color="FF000000"}}(),i=function(){return function(){}}(),l=function(){return function(){}}(),s=function(){return function(){}}(),a=function(){return function(){this.name="Normal",this.xfId=0}}(),d=function(){return function(e,t){this.numFmtId=e,this.formatCode=t}}(),m=function(){return function(e,t){this.lineStyle=e,this.color=t}}(),p=function(){return function(){this.left=new m("none","#FFFFFF"),this.right=new m("none","#FFFFFF"),this.top=new m("none","#FFFFFF"),this.bottom=new m("none","#FFFFFF"),this.all=new m("none","#FFFFFF")}}(),h=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),u=function(){return function(){}}(),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.add=function(e){for(var o=!1,r=0,n=0,i=t;n<i.length;n++){i[n].index===e.index&&(t[r]=e,o=!0),r++}o||t.push(e)},t}return h(t,e),t}(Array),f=function(){return function(){}}(),y=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),v=function(){return function(){}}(),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.add=function(e){for(var o=!1,r=0,n=0,i=t;n<i.length;n++){i[n].index===e.index&&(t[r]=e,o=!0),r++}o||t.push(e)},t}return y(t,e),t}(Array),b=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return b(t,e),t}(Array),w=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),S=function(){return function(){this.isSummaryRowBelow=!0,this.showGridLines=!0}}(),F=function(){return function(){}}(),C=function(){return function(){}}(),k=function(){return function(){}}(),I=function(){return function(){}}(),T=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.add=function(e){for(var r=!1,n=0,i=0,l=o;i<l.length;i++){var s=l[i];if(t.isIntersecting(s,e)){var a=new I;a.x=Math.min(s.x,e.x),a.y=Math.min(s.Y,e.y),a.width=Math.max(s.Width+s.X,e.width+e.x),a.height=Math.max(s.Height+s.Y,e.height+e.y),a.ref=o[n].ref.split(":")[0]+":"+e.ref.split(":")[1],o[n]=a,e=a,r=!0}n++}return r||o.push(e),e},o}return w(t,e),t.isIntersecting=function(e,t){return e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height},t}(Array),N=function(){function e(e){this.intl=new o.Internationalization}return e.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},e.prototype.toView=function(e,t){var r=e;return o.isNullOrUndefined(t)||o.isNullOrUndefined(e)||(r=t(e)),r},e.prototype.displayText=function(e,t){return this.toView(e,this.getFormatFunction(t))},e}(),A=function(){function e(e){if(this.csvStr="",this.formatter=new N,this.isMicrosoftBrowser=!!navigator.msSaveBlob,null!==e.styles&&void 0!==e.styles){this.globalStyles=new Map;for(var t=0;t<e.styles.length;t++)void 0!==e.styles[t].name&&void 0!==e.styles[t].numberFormat&&this.globalStyles.set(e.styles[t].name,e.styles[t].numberFormat)}null!==e.worksheets&&void 0!==e.worksheets&&this.parseWorksheet(e.worksheets[0])}return e.prototype.parseWorksheet=function(e){null!==e.rows&&void 0!==e.rows&&this.parseRows(e.rows)},e.prototype.parseRows=function(e){for(var t=1,o=0,r=e;o<r.length;o++){var n=r[o];if(null===n.index||void 0===n.index)throw Error("Row index is missing.");for(;t<n.index;)this.csvStr+="\n",t++;this.parseRow(n)}},e.prototype.parseRow=function(e){if(null!==e.cells&&void 0!==e.cells)for(var t=1,o=0,r=e.cells;o<r.length;o++){var n=r[o];if(null===n.index||void 0===n.index)throw Error("Cell index is missing.");for(;t<n.index;)this.csvStr+=",",t++;this.parseCell(n)}},e.prototype.parseCell=function(e){var t=this.csvStr;void 0!==e.value&&(e.value instanceof Date?void 0!==e.style&&void 0!==e.style.numberFormat?t+=this.parseCellValue(this.formatter.displayText(e.value,{type:"dateTime",skeleton:e.style.numberFormat})):void 0!==e.style&&void 0!==e.style.name&&this.globalStyles.has(e.style.name)?t+=this.parseCellValue(this.formatter.displayText(e.value,{type:"dateTime",skeleton:this.globalStyles.get(e.style.name)})):t+=e.value:"boolean"==typeof e.value?t+=e.value?"TRUE":"FALSE":"number"==typeof e.value?void 0!==e.style&&void 0!==e.style.numberFormat?t+=this.parseCellValue(this.formatter.displayText(e.value,{format:e.style.numberFormat})):void 0!==e.style&&void 0!==e.style.name&&this.globalStyles.has(e.style.name)?t+=this.parseCellValue(this.formatter.displayText(e.value,{format:this.globalStyles.get(e.style.name)})):t+=e.value:t+=this.parseCellValue(e.value)),this.csvStr=t},e.prototype.parseCellValue=function(e){return-1!==e.indexOf(",")?e='"'+e+'"':e},e.prototype.save=function(e){if(this.buffer=new Blob(["\ufeff"+this.csvStr],{type:"text/csv;charset=UTF-8"}),this.isMicrosoftBrowser)navigator.msSaveBlob(this.buffer,e);else{var t=window.URL.createObjectURL(this.buffer),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.download=e,o.href=t;var r=document.createEvent("MouseEvent");r.initEvent("click",!0,!0),o.dispatchEvent(r),setTimeout(function(){window.URL.revokeObjectURL(t)})}},e.prototype.saveAsBlob=function(){return new Blob(["\ufeff"+this.csvStr],{type:"text/csv;charset=UTF-8"})},e}(),P=function(){function e(){this.parts=[]}return e.prototype.append=function(e){this.parts.push(e),this.blob=void 0},e.prototype.getBlob=function(){return new Blob(this.parts,{type:"text/plain"})},e}(),B=function(){function e(e,i,l,s){if(this.sharedStringCount=0,this.unitsProportions=[1.28,.32,96,96/25.4,96/2.54,1,96/72,96/72/12700],this.hyperlinkStyle={fontColor:"#0000FF",underline:!0},this.culture=void 0!==l?l:"en-US",this.currency=void 0!==s?s:"USD",this.intl=new o.Internationalization(this.culture),this.mSaveType=i,"xlsx"===i){if(this.mArchive=new t.ZipArchive,this.sharedString=[],this.mFonts=[],this.mBorders=[],this.mStyles=[],this.printTitles=new Map,this.cellStyles=new Map,this.mNumFmt=new Map,this.mFills=new Map,this.mStyles.push(new r),this.mFonts.push(new n),this.cellStyles.set("Normal",new a),this.mCellXfs=[],this.mCellStyleXfs=[],null!==e.styles&&void 0!==e.styles){this.globalStyles=new Map;for(var d=0;d<e.styles.length;d++)if(void 0!==e.styles[d].name){if(this.cellStyles.has(e.styles[d].name))throw Error("Style name "+e.styles[d].name+" is already existed");var m=new r;m.isGlobalStyle=!0,this.parserCellStyle(e.styles[d],m,"none");var p=new a;p.name=m.name,p.xfId=m.index-1,this.cellStyles.set(p.name,p);var h={};void 0!==e.styles[d].numberFormat&&(h.format=e.styles[d].numberFormat),void 0!==e.styles[d].type?h.type=e.styles[d].type:h.type="datetime",void 0!==h.format&&this.globalStyles.set(e.styles[d].name,h)}}if(null===e.worksheets||void 0===e.worksheets)throw Error("Worksheet is expected.");this.parserWorksheets(e.worksheets),null!==e.builtInProperties&&void 0!==e.builtInProperties&&(this.builtInProperties=new R,this.parserBuiltInProperties(e.builtInProperties,this.builtInProperties))}else this.csvHelper=new A(e)}return e.prototype.parserBuiltInProperties=function(e,t){null!==e.author&&void 0!==e.author&&(t.author=e.author),null!==e.comments&&void 0!==e.comments&&(t.comments=e.comments),null!==e.category&&void 0!==e.category&&(t.category=e.category),null!==e.company&&void 0!==e.company&&(t.company=e.company),null!==e.manager&&void 0!==e.manager&&(t.manager=e.manager),null!==e.subject&&void 0!==e.subject&&(t.subject=e.subject),null!==e.title&&void 0!==e.title&&(t.title=e.title),null!==e.createdDate&&void 0!==e.createdDate&&(t.createdDate=e.createdDate),null!==e.modifiedDate&&void 0!==e.modifiedDate&&(t.modifiedDate=e.modifiedDate),null!==e.tags&&void 0!==e.tags&&(t.tags=e.tags),null!==e.status&&void 0!==e.status&&(t.status=e.status)},e.prototype.parserWorksheets=function(e){this.worksheets=new x;for(var t=e.length,o=0;o<t;o++){var r=e[o],n=new S;this.mergeCells=new T,this.mergedCellsStyle=new Map,this.mHyperLinks=[],null!==r.name&&void 0!==r.name?n.name=r.name:n.name="Sheet"+(o+1).toString(),n.index=o+1,null!==r.columns&&void 0!==r.columns&&this.parserColumns(r.columns,n),null!==r.rows&&void 0!==r.rows&&this.parserRows(r.rows,n),null!==r.showGridLines&&void 0!==r.showGridLines&&(n.showGridLines=r.showGridLines),null!==r.freeze&&void 0!==r.freeze&&this.parserFreezePanes(r.freeze,n),null!==r.printTitle&&void 0!==r.printTitle&&this.parserPrintTitle(r.printTitle,n),void 0!==r.pageSetup&&void 0!==r.pageSetup.isSummaryRowBelow&&(n.isSummaryRowBelow=r.pageSetup.isSummaryRowBelow),n.index=o+1,n.mergeCells=this.mergeCells,n.hyperLinks=this.mHyperLinks,this.worksheets.push(n)}},e.prototype.mergeOptions=function(e,t){var o={};return this.applyProperties(e,o),this.applyProperties(t,o),o},e.prototype.applyProperties=function(e,t){for(var o=Object.keys(e),r=0;r<o.length;r++)"name"!==o[r]&&(t[o[r]]=e[o[r]])},e.prototype.getCellName=function(e,t){return this.getColumnName(t)+e.toString()},e.prototype.getColumnName=function(e){e--;var t="";do{var o=e%26;e=e/26-1,t=String.fromCharCode(65+o)+t}while(e>=0);return t},e.prototype.parserPrintTitle=function(e,t){var o,r="";if(null!==e.fromRow&&void 0!==e.fromRow){o="$"+e.fromRow+":$"+(null!==e.toRow&&void 0!==e.toRow?e.toRow:e.fromRow)}var n;if(null!==e.fromColumn&&void 0!==e.fromColumn){var i=e.fromColumn,l=void 0;l=null!==e.toColumn&&void 0!==e.toColumn?e.toColumn:e.fromColumn,n="$"+this.getColumnName(i)+":$"+this.getColumnName(l)}void 0!==o&&(r+=t.name+"!"+o),void 0!==n&&void 0!==o?r+=","+t.name+"!"+n:void 0!==n&&(r+=t.name+"!"+n),""!==r&&this.printTitles.set(t.index-1,r)},e.prototype.parserFreezePanes=function(e,t){t.freezePanes=new k,null!==e.row&&void 0!==e.row?t.freezePanes.row=e.row:t.freezePanes.row=0,null!==e.column&&void 0!==e.column?t.freezePanes.column=e.column:t.freezePanes.column=0,t.freezePanes.leftCell=this.getCellName(t.freezePanes.row+1,t.freezePanes.column+1)},e.prototype.parserColumns=function(e,t){var o=e.length;t.columns=[];for(var r=0;r<o;r++){var n=new f;if(null===e[r].index||void 0===e[r].index)throw Error("Column index is missing.");n.index=e[r].index,null!==e[r].width&&void 0!==e[r].width&&(n.width=e[r].width),t.columns.push(n)}},e.prototype.parserRows=function(e,t){var o=e.length;t.rows=new g;for(var r=0,n=0;n<o;n++){var i=this.parserRow(e[n],r);r=i.index,t.rows.add(i)}this.insertMergedCellsStyle(t)},e.prototype.insertMergedCellsStyle=function(e){var t=this;this.mergeCells.length>0&&this.mergedCellsStyle.forEach(function(r,n){var i=e.rows.filter(function(e){return e.index===r.y})[0];if(o.isNullOrUndefined(i)){var l=e.rows.filter(function(e){return e.index<=r.y}),s=new v;s.index=r.y,s.cells=new c,s.cells.add(t.createCell(r,n));m=0;l.length>0&&(m=e.rows.indexOf(l[l.length-1])+1),e.rows.splice(m,0,s)}else{var a=i.cells.filter(function(e){return e.index===r.x})[0];if(o.isNullOrUndefined(a)){var d=i.cells.filter(function(e){return e.index<=r.x}),m=0;d.length>0&&(m=i.cells.indexOf(d[d.length-1])+1),i.cells.splice(m,0,t.createCell(r,n))}else a.styleIndex=r.styleIndex}})},e.prototype.createCell=function(e,t){var o=new u;return o.refName=t,o.index=e.x,o.cellStyle=new r,o.styleIndex=e.styleIndex,o},e.prototype.parserRow=function(e,t){var o=new v;if(null!==e.height&&void 0!==e.height&&(o.height=e.height),null===e.index||void 0===e.index)throw Error("Row index is missing.");return o.index=e.index,null!==e.grouping&&void 0!==e.grouping&&this.parseGrouping(e.grouping,o),this.parseCells(e.cells,o),o},e.prototype.parseGrouping=function(e,t){t.grouping=new C,void 0!==e.outlineLevel&&(t.grouping.outlineLevel=e.outlineLevel),void 0!==e.isCollapsed&&(t.grouping.isCollapsed=e.isCollapsed),void 0!==e.isHidden&&(t.grouping.isHidden=e.isHidden)},e.prototype.parseCells=function(e,t){t.cells=new c;for(var o=void 0!==e?e.length:0,n=1,i=1,l=0;l<o;l++){var s=e[l],a=new u;if(null===s.index||void 0===s.index)throw Error("Cell index is missing.");if(a.index=s.index,a.index<n?n=a.index:a.index>i&&(i=a.index),a.refName=this.getCellName(t.index,a.index),null!==s.rowSpan&&void 0!==s.rowSpan?a.rowSpan=s.rowSpan-1:a.rowSpan=0,null!==s.colSpan&&void 0!==s.colSpan?a.colSpan=s.colSpan-1:a.colSpan=0,null!==s.hyperlink&&void 0!==s.hyperlink){var d=new F;void 0!==s.hyperlink.target&&(d.target=s.hyperlink.target,void 0!==s.hyperlink.displayText?a.value=s.hyperlink.displayText:a.value=s.hyperlink.target,a.type=this.getCellValueType(a.value),d.ref=a.refName,d.rId=this.mHyperLinks.length+1,this.mHyperLinks.push(d),a.cellStyle=new r,this.parserCellStyle(void 0!==s.style?this.mergeOptions(s.style,this.hyperlinkStyle):this.hyperlinkStyle,a.cellStyle,"string"),a.styleIndex=a.cellStyle.index)}null!==s.value&&void 0!==s.value&&(a.value=s.value,a.type=this.getCellValueType(a.value)),null!==s.style&&void 0!==s.style&&void 0===a.styleIndex?(a.cellStyle=new r,a.value instanceof Date?this.parserCellStyle(s.style,a.cellStyle,a.type,14):this.parserCellStyle(s.style,a.cellStyle,a.type),a.styleIndex=a.cellStyle.index):a.value instanceof Date&&(a.cellStyle=new r,this.parserCellStyle({},a.cellStyle,a.type,14),a.styleIndex=a.cellStyle.index),this.parseCellType(a),this.mergeCells=this.processMergeCells(a,t.index,this.mergeCells),t.cells.add(a)}t.spans=n+":"+i},e.prototype.applyGlobalStyle=function(e,t){this.cellStyles.has(e.name)&&(t.index=this.mStyles.filter(function(t){return t.name===e.name})[0].index,t.name=e.name)},e.prototype.parserCellStyle=function(e,t,o,r){if(null!==e.name&&void 0!==e.name){if(!t.isGlobalStyle)return void this.applyGlobalStyle(e,t);t.name=e.name}null!==e.backColor&&void 0!==e.backColor&&(t.backColor=e.backColor),t.borders=new p,null!==e.borders&&void 0!==e.borders&&this.parserBorder(e.borders,t.borders.all),null!==e.leftBorder&&void 0!==e.leftBorder&&this.parserBorder(e.leftBorder,t.borders.left),null!==e.rightBorder&&void 0!==e.rightBorder&&this.parserBorder(e.rightBorder,t.borders.right),null!==e.topBorder&&void 0!==e.topBorder&&this.parserBorder(e.topBorder,t.borders.top),null!==e.bottomBorder&&void 0!==e.bottomBorder&&this.parserBorder(e.bottomBorder,t.borders.bottom),null!==e.fontName&&void 0!==e.fontName&&(t.fontName=e.fontName),null!==e.fontSize&&void 0!==e.fontSize&&(t.fontSize=e.fontSize),null!==e.fontColor&&void 0!==e.fontColor&&(t.fontColor=e.fontColor),null!==e.italic&&void 0!==e.italic&&(t.italic=e.italic),null!==e.bold&&void 0!==e.bold&&(t.bold=e.bold),null!==e.hAlign&&void 0!==e.hAlign&&(t.hAlign=e.hAlign),null!==e.indent&&void 0!==e.indent&&(t.indent=e.indent,"left"!==t.hAlign&&"right"!==t.hAlign&&(t.hAlign="left")),null!==e.vAlign&&void 0!==e.vAlign&&(t.vAlign=e.vAlign),null!==e.underline&&void 0!==e.underline&&(t.underline=e.underline),null!==e.wrapText&&void 0!==e.wrapText&&(t.wrapText=e.wrapText),null!==e.numberFormat&&void 0!==e.numberFormat?null!==e.type&&void 0!==e.type?t.numberFormat=this.getNumberFormat(e.numberFormat,e.type):t.numberFormat=this.getNumberFormat(e.numberFormat,o):void 0!==r?(t.numFmtId=14,t.numberFormat="GENERAL"):t.numberFormat="GENERAL",t.index=this.processCellStyle(t)},e.prototype.switchNumberFormat=function(e,t){var o=this.getNumberFormat(e,t);if(o!==e){var r=this.mNumFmt.get(e);if(void 0!==r&&(r.formatCode=o,this.mNumFmt.has(o))){for(var n=0,i=this.mCellStyleXfs;n<i.length;n++){var l=i[n];l.numFmtId===r.numFmtId&&(l.numFmtId=this.mNumFmt.get(o).numFmtId)}for(var s=0,a=this.mCellXfs;s<a.length;s++){var d=a[s];d.numFmtId===r.numFmtId&&(d.numFmtId=this.mNumFmt.get(o).numFmtId)}}}},e.prototype.getNumberFormat=function(e,t){var o;switch(t){case"number":try{o=this.intl.getNumberPattern({format:e,currency:this.currency})}catch(t){o=e}break;case"datetime":try{o=this.intl.getDatePattern({skeleton:e,type:"dateTime"},!0)}catch(t){o=e}break;case"date":try{o=this.intl.getDatePattern({skeleton:e,type:"date"},!0)}catch(t){o=e}break;case"time":try{o=this.intl.getDatePattern({skeleton:e,type:"time"},!0)}catch(t){o=e}break;default:o=e}return o},e.prototype.parserBorder=function(e,t){null!==e.color&&void 0!==e.color?t.color=e.color:t.color="#000000",null!==e.lineStyle&&void 0!==e.lineStyle?t.lineStyle=e.lineStyle:t.lineStyle="thin"},e.prototype.processCellStyle=function(e){if(e.isGlobalStyle)return this.processNumFormatId(e),this.mStyles.push(e),this.mStyles.length;var t=this.compareStyle(e);return t.result?t.index:(this.processNumFormatId(e),this.mStyles.push(e),this.mStyles.length)},e.prototype.processNumFormatId=function(e){if("GENERAL"!==e.numberFormat&&!this.mNumFmt.has(e.numberFormat)){var t=this.mNumFmt.size+164;this.mNumFmt.set(e.numberFormat,new d(t,e.numberFormat))}},e.prototype.isNewFont=function(e){for(var t=!1,o=0,r=0,n=this.mFonts;r<n.length;r++){var i=n[r];o++;var l=void 0;if(void 0!==e.fontColor&&(l="FF"+e.fontColor.replace("#","")),t=i.color===l&&i.b===e.bold&&i.i===e.italic&&i.u===e.underline&&i.name===e.fontName&&i.sz===e.fontSize)break}return o-=1,{index:o,result:t}},e.prototype.isNewBorder=function(e){var t=new r;return this.isAllBorder(e.borders)?t.borders.all.color===e.borders.all.color&&t.borders.all.lineStyle===e.borders.all.lineStyle:t.borders.left.color===e.borders.left.color&&t.borders.left.lineStyle===e.borders.left.lineStyle&&t.borders.right.color===e.borders.right.color&&t.borders.right.lineStyle===e.borders.right.lineStyle&&t.borders.top.color===e.borders.top.color&&t.borders.top.lineStyle===e.borders.top.lineStyle&&t.borders.bottom.color===e.borders.bottom.color&&t.borders.bottom.lineStyle===e.borders.bottom.lineStyle},e.prototype.isAllBorder=function(e){var t=new r;return t.borders.all.color!==e.all.color&&t.borders.all.lineStyle!==e.all.lineStyle},e.prototype.compareStyle=function(e){for(var t=!0,o=0,r=0,n=this.mStyles;r<n.length;r++){var i=n[r];if(t=!i.isGlobalStyle&&(i.backColor===e.backColor&&i.bold===e.bold&&i.numFmtId===e.numFmtId&&i.numberFormat===e.numberFormat&&i.type===e.type&&i.fontColor===e.fontColor&&i.fontName===e.fontName&&i.fontSize===e.fontSize&&i.hAlign===e.hAlign&&i.italic===e.italic&&i.underline===e.underline&&i.vAlign===e.vAlign&&i.indent===e.indent&&i.wrapText===e.wrapText&&i.borders.all.color===e.borders.all.color&&i.borders.all.lineStyle===e.borders.all.lineStyle&&i.borders.left.color===e.borders.left.color&&i.borders.left.lineStyle===e.borders.left.lineStyle&&i.borders.right.color===e.borders.right.color&&i.borders.right.lineStyle===e.borders.right.lineStyle&&i.borders.top.color===e.borders.top.color&&i.borders.top.lineStyle===e.borders.top.lineStyle&&i.borders.bottom.color===e.borders.bottom.color&&i.borders.bottom.lineStyle===e.borders.bottom.lineStyle)){o=i.index;break}}return{index:o,result:t}},e.prototype.contains=function(e,t){var o=e.indexOf(t);return o>-1&&o<e.length},e.prototype.getCellValueType=function(e){return e instanceof Date?"datetime":"boolean"==typeof e?"boolean":"number"==typeof e?"number":"string"},e.prototype.parseCellType=function(e){var t,o=e.type,r=e.value;switch(o){case"datetime":if(r=this.toOADate(r),void 0!==e.cellStyle&&void 0!==e.cellStyle.name&&this.globalStyles.has(e.cellStyle.name)){var n=this.globalStyles.get(e.cellStyle.name);this.switchNumberFormat(n.format,n.type)}t="n";break;case"boolean":r=r?1:0,t="b";break;case"number":t="n",void 0!==e.cellStyle&&void 0!==e.cellStyle.name&&this.globalStyles.has(e.cellStyle.name)&&this.switchNumberFormat(this.globalStyles.get(e.cellStyle.name).format,"number");break;case"string":this.sharedStringCount++,t="s",this.contains(this.sharedString,r)||this.sharedString.push(r),r=this.sharedString.indexOf(r)}e.saveType=t,e.value=r},e.prototype.saveAsBlob=function(e){var t=this;switch(e){case"text/csv":return new Promise(function(e,o){var r={};r.blobData=t.csvHelper.saveAsBlob(),e(r)});default:return new Promise(function(e,o){t.saveInternal(),t.mArchive.saveAsBlob().then(function(t){var o={};o.blobData=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),e(o)})})}},e.prototype.save=function(e,t){var o=this;if(null===e||void 0===e||""===e)throw new Error("Argument Null Exception: fileName cannot be null or empty");var r=e.match(".xlsx$"),n=e.match(".csv$");if(null!==r&&r[0]==="."+this.mSaveType)this.saveInternal(),this.mArchive.save(e).then(function(){o.mArchive.destroy()});else{if(null===n||n[0]!=="."+this.mSaveType)throw Error("Save type and file extension is different.");this.csvHelper.save(e)}},e.prototype.saveInternal=function(){this.saveWorkbook(),this.saveWorksheets(),this.saveSharedString(),this.saveStyles(),this.saveApp(this.builtInProperties),this.saveCore(this.builtInProperties),this.saveContentType(),this.saveTopLevelRelation(),this.saveWorkbookRelation()},e.prototype.saveWorkbook=function(){for(var e='<?xml version="1.0" encoding="utf-8"?><workbook xmlns:r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns= "http://schemas.openxmlformats.org/spreadsheetml/2006/main"><workbookPr codeName="ThisWorkbook" defaultThemeVersion= "153222"/><bookViews><workbookView activeTab="0"/></bookViews>',t="<sheets>",o=this.worksheets.length,r=0;r<o;r++)t+='<sheet name="'+this.worksheets[r].name+'" sheetId="'+(r+1).toString()+'" r:id ="rId'+(r+1).toString()+'" />';if(t+="</sheets>",e+=t,this.printTitles.size>0){var n="<definedNames>";this.printTitles.forEach(function(e,t){n+='<definedName name="_xlnm.Print_Titles" localSheetId="'+t+'">'+e+"</definedName>"}),e+=n+="</definedNames>"}this.addToArchive(e+"</workbook>","xl/workbook.xml")},e.prototype.saveWorksheets=function(){for(var e=this.worksheets.length,t=0;t<e;t++)this.saveWorksheet(this.worksheets[t],t)},e.prototype.saveWorksheet=function(e,t){var r=new P,n='<?xml version="1.0" encoding="utf-8" standalone="yes"?><worksheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';if(e.isSummaryRowBelow?n+="<sheetPr />":n+='<sheetPr><outlinePr summaryBelow="0" ></outlinePr></sheetPr>',n+=this.saveSheetView(e),void 0!==e.columns){for(var i="<cols>",l=0,s=e.columns;l<s.length;l++){var a=s[l];void 0!==a.width?i+='<col min="'+a.index+'" max="'+a.index+'" width="'+this.pixelsToColumnWidth(a.width)+'" customWidth="1" />':i+='<col min="'+a.index+'" max="'+a.index+'" width="8.43" customWidth="1" />'}n+=i+"</cols>"}if(n+="<sheetData>",r.append(n),n="",void 0!==e.rows)for(var d=0,m=e.rows;d<m.length;d++){var p=m[d],h='<row r="'+p.index+'" ';o.isNullOrUndefined(p.spans)||(h+='spans="'+p.spans+'" '),void 0!==p.height&&(h+='ht="'+this.pixelsToRowHeight(p.height)+'" customHeight="1" '),void 0!==p.grouping&&(p.grouping.isHidden&&(h+='hidden="1" '),void 0!==p.grouping.outlineLevel&&(h+='outlineLevel="'+p.grouping.outlineLevel+'" '),p.grouping.isCollapsed&&(h+='collapsed="1" ')),h+=">";for(var u=0,c=p.cells;u<c.length;u++){var f=c[u];void 0===f||void 0===f.value&&void 0===f.cellStyle||(h+='<c r="'+f.refName+'" ',void 0!==f.saveType&&(h+='t="'+f.saveType+'" '),void 0!==f.styleIndex&&(h+='s="'+f.styleIndex+'" '),h+=" >",void 0!==f.value?h+="<v>"+f.value+"</v></c>":h+="</c>")}h+="</row>",r.append(h)}if(n+="</sheetData>",e.mergeCells.length>0){n+='<mergeCells count="'+e.mergeCells.length+'">';for(var y=0,v=e.mergeCells;y<v.length;y++){n+='<mergeCell ref="'+v[y].ref+'" />'}n+="</mergeCells>"}if(e.hyperLinks.length>0){n+="<hyperlinks>";for(var g=0,b=e.hyperLinks;g<b.length;g++){var x=b[g];n+='<hyperlink ref="'+x.ref+'" r:id="rId'+x.rId+'" />'}n+="</hyperlinks>",this.addToArchive(this.saveSheetRelations(e),"xl/worksheets/_rels/sheet"+e.index+".xml.rels")}n+='<pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5" /><headerFooter scaleWithDoc="1" alignWithMargins="0" differentFirst="0" differentOddEven="0" /></worksheet>',r.append(n),this.addToArchive(r.getBlob(),"xl/worksheets/sheet"+(t+1)+".xml")},e.prototype.pixelsToColumnWidth=function(e){var t=e>12?this.trunc((e-5)/7*100+.5)/100:e/12;return t>1?(7*t+5)/7*256/256:12*t/7*256/256},e.prototype.trunc=function(e){var t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t},e.prototype.pixelsToRowHeight=function(e){return e*this.unitsProportions[5]/this.unitsProportions[6]},e.prototype.saveSheetRelations=function(e){for(var t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',o=0,r=e.hyperLinks;o<r.length;o++){var n=r[o];t+='<Relationship Id="rId'+n.rId+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="'+n.target+'" TargetMode="External" />'}return t+="</Relationships>"},e.prototype.saveSheetView=function(e){var t='<sheetViews><sheetView workbookViewId="0" ';return!1===e.showGridLines?t+='showGridLines="0" >':t+=">",void 0!==e.freezePanes&&(t+='<pane state="frozen" topLeftCell="'+e.freezePanes.leftCell+'" ',0!==e.freezePanes.row&&(t+='ySplit="'+e.freezePanes.row+'" '),0!==e.freezePanes.column&&(t+='xSplit="'+e.freezePanes.column+'" '),t+="/>"),t+="</sheetView></sheetViews > "},e.prototype.saveSharedString=function(){var e=this.sharedString.length;if(e>0){for(var t='<?xml version="1.0" encoding="utf-8"?><sst uniqueCount="'+e+'" count="'+this.sharedStringCount+'" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">',o="",r=0;r<e;r++)o+="<si><t>",o+=this.processString(this.sharedString[r]),o+="</t></si>";o+="</sst>",this.addToArchive(t+o,"xl/sharedStrings.xml")}},e.prototype.processString=function(e){return-1!==e.indexOf("&")&&(e=e.replace(/&/g,"&amp;")),-1!==e.indexOf("<")&&(e=e.replace(/</g,"&lt;")),-1!==e.indexOf(">")&&(e=e.replace(/>/g,"&gt;")),e},e.prototype.saveStyles=function(){this.updateCellXfsStyleXfs();var e='<?xml version="1.0" encoding="utf-8"?><styleSheet xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';e+=this.saveNumberFormats(),e+=this.saveFonts(),e+=this.saveFills(),e+=this.saveBorders(),e+=this.saveCellStyleXfs(),e+=this.saveCellXfs(),e+=this.saveCellStyles(),this.addToArchive(e+"</styleSheet>","xl/styles.xml")},e.prototype.updateCellXfsStyleXfs=function(){for(var e=0,t=this.mStyles;e<t.length;e++){var o=t[e],r=void 0;o.isGlobalStyle?(r=new s).xfId=o.index-1:(r=new i).xfId=0;var a=this.isNewFont(o);if(a.result)r.fontId=a.index;else{var m=new n;m.b=o.bold,m.i=o.italic,m.name=o.fontName,m.sz=o.fontSize,m.u=o.underline,m.color="FF"+o.fontColor.replace("#",""),this.mFonts.push(m),r.fontId=this.mFonts.length-1}if("none"!==o.backColor){var p="FF"+o.backColor.replace("#","");if(this.mFills.has(p)){var h=this.mFills.get(p);r.fillId=h}else{h=this.mFills.size+2;this.mFills.set(p,h),r.fillId=h}}else r.fillId=0;if(this.isNewBorder(o)?r.borderId=0:(this.mBorders.push(o.borders),r.borderId=this.mBorders.length),"GENERAL"!==o.numberFormat)if(this.mNumFmt.has(o.numberFormat)){var u=this.mNumFmt.get(o.numberFormat);r.numFmtId=u.numFmtId}else{var c=this.mNumFmt.size+164;this.mNumFmt.set(o.numberFormat,new d(c,o.numberFormat)),r.numFmtId=c}else"GENERAL"===o.numberFormat&&14===o.numFmtId?r.numFmtId=14:r.numFmtId=0;o.isGlobalStyle||(r.applyAlignment=1),r.alignment=new l,r.alignment.indent=o.indent,r.alignment.horizontal=o.hAlign,r.alignment.vertical=o.vAlign,r.alignment.wrapText=o.wrapText?1:0,o.isGlobalStyle?(this.mCellStyleXfs.push(r),this.mCellXfs.push(r)):this.mCellXfs.push(r)}},e.prototype.saveNumberFormats=function(){if(this.mNumFmt.size>=1){var e='<numFmts count="'+this.mNumFmt.size+'">';return this.mNumFmt.forEach(function(t,o){e+='<numFmt numFmtId="'+t.numFmtId+'" formatCode="'+t.formatCode.replace(/"/g,"&quot;")+'" />'}),e+="</numFmts>"}return""},e.prototype.saveFonts=function(){var e='<fonts count="'+this.mFonts.length+'">';if(this.mFonts.length>=1)for(var t=0,o=this.mFonts;t<o.length;t++){var r=o[t];e+="<font>",r.b&&(e+="<b />"),r.i&&(e+="<i />"),r.u&&(e+="<u />"),e+='<sz val="'+this.pixelsToRowHeight(r.sz)+'" />',e+='<color rgb="'+r.color+'" />',e+='<name val="'+r.name+'" /></font>'}return e+"</fonts>"},e.prototype.saveFills=function(){var e='<fills count="'+(this.mFills.size+2)+'"><fill><patternFill patternType="none"></patternFill></fill><fill><patternFill patternType="gray125"></patternFill></fill>';return this.mFills.size>=1&&this.mFills.forEach(function(t,o){e+='<fill><patternFill patternType="solid"><fgColor rgb="'+o+'" /><bgColor rgb="FFFFFFFF" /></patternFill></fill>'}),e+"</fills>"},e.prototype.saveBorders=function(){var e='<borders count="'+(this.mBorders.length+1)+'"><border><left /><right /><top /><bottom /><diagonal /></border>';if(this.mBorders.length>=1)for(var t=0,o=this.mBorders;t<o.length;t++){var r=o[t];if(this.isAllBorder(r)){var n=r.all.color.replace("#",""),i=r.all.lineStyle;e+='<border><left style="'+i+'"><color rgb="FF'+n+'" /></left><right style="'+i+'"><color rgb="FF'+n+'" /></right><top style="'+i+'"><color rgb="FF'+n+'" /></top><bottom style="'+i+'"><color rgb="FF'+n+'" /></bottom></border>'}else e+='<border><left style="'+r.left.lineStyle+'"><color rgb="FF'+r.left.color.replace("#","")+'" /></left><right style="'+r.right.lineStyle+'"><color rgb="FF'+r.right.color.replace("#","")+'" /></right><top style="'+r.top.lineStyle+'"><color rgb="FF'+r.top.color.replace("#","")+'" /></top><bottom style="'+r.bottom.lineStyle+'"><color rgb="FF'+r.bottom.color.replace("#","")+'" /></bottom></border>'}return e+"</borders>"},e.prototype.saveCellStyles=function(){var e=this,t='<cellStyles count="'+this.cellStyles.size+'">';return this.cellStyles.forEach(function(o,r){t+='<cellStyle name="'+r+'" xfId="'+e.cellStyles.get(r).xfId+'"',"Normal"===r&&(t+=' builtinId="0"'),t+=" />"}),t+="</cellStyles>"},e.prototype.saveCellStyleXfs=function(){var e='<cellStyleXfs count="'+(this.mCellStyleXfs.length+1)+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" />';if(this.mCellStyleXfs.length>=1)for(var t=0,o=this.mCellStyleXfs;t<o.length;t++){var r=o[t];e+='<xf numFmtId="'+r.numFmtId+'" fontId="'+r.fontId+'" fillId="'+r.fillId+'" borderId="'+r.borderId+'" ',void 0!==r.alignment?e+=">"+this.saveAlignment(r)+"</xf>":e+=" />"}return e+"</cellStyleXfs>"},e.prototype.saveCellXfs=function(){var e='<cellXfs count="'+(this.mCellXfs.length+1)+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />';if(this.mCellXfs.length>=1)for(var t=0,o=this.mCellXfs;t<o.length;t++){var r=o[t];e+='<xf numFmtId="'+r.numFmtId+'" fontId="'+r.fontId+'" fillId="'+r.fillId+'" borderId="'+r.borderId+'" xfId="'+r.xfId+'" ',1===r.applyAlignment&&(e+='applyAlignment="1"'),e+=">"+this.saveAlignment(r)+"</xf>"}return e+"</cellXfs>"},e.prototype.saveAlignment=function(e){var t="<alignment ";return void 0!==e.alignment.horizontal&&(t+='horizontal="'+e.alignment.horizontal+'" '),void 0!==e.alignment.indent&&(t+='indent="'+e.alignment.indent+'" '),void 0!==e.alignment.vertical&&(t+='vertical="'+e.alignment.vertical+'" '),t+='wrapText="'+e.alignment.wrapText+'" />'},e.prototype.saveApp=function(e){var t='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>Essential XlsIO</Application>';void 0!==e&&(void 0!==e.manager&&(t+="<Manager>"+e.manager+"</Manager>"),void 0!==e.company&&(t+="<Company>"+e.company+"</Company>")),this.addToArchive(t+"</Properties>","docProps/app.xml")},e.prototype.saveCore=function(e){var t=new Date,o='<?xml version="1.0" encoding="utf-8" standalone="yes"?><cp:coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">';void 0!==this.builtInProperties?(void 0!==e.author&&(o+="<dc:creator>"+e.author+"</dc:creator>"),void 0!==e.subject&&(o+="<dc:subject>"+e.subject+"</dc:subject>"),void 0!==e.category&&(o+="<cp:category>"+e.category+"</cp:category>"),void 0!==e.comments&&(o+="<dc:description>"+e.comments+"</dc:description>"),void 0!==e.title&&(o+="<dc:title>"+e.title+"</dc:title>"),void 0!==e.tags&&(o+="<cp:keywords>"+e.tags+"</cp:keywords>"),void 0!==e.status&&(o+="<cp:contentStatus>"+e.status+"</cp:contentStatus>"),void 0!==e.createdDate?o+='<dcterms:created xsi:type="dcterms:W3CDTF">'+e.createdDate.toISOString()+"</dcterms:created>":o+='<dcterms:created xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:created>",void 0!==e.modifiedDate?o+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+e.modifiedDate.toISOString()+"</dcterms:modified>":o+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:modified>"):(o+='<dcterms:created xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:created>",o+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:modified>"),o+="</cp:coreProperties>",this.addToArchive(o,"docProps/core.xml")},e.prototype.saveTopLevelRelation=function(){this.addToArchive('<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml" /><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" /><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" /></Relationships>',"_rels/.rels")},e.prototype.saveWorkbookRelation=function(){for(var e='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',t=this.worksheets.length,o=0,r=0;r<t;r++,o++)e+='<Relationship Id="rId'+(r+1).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(r+1).toString()+'.xml" />';e+='<Relationship Id="rId'+(++o).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />',this.sharedStringCount>0&&(e+='<Relationship Id="rId'+(++o).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" />'),this.addToArchive(e+"</Relationships>","xl/_rels/workbook.xml.rels")},e.prototype.saveContentType=function(){for(var e='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />',t="",o=this.worksheets.length,r=0;r<o;r++)t+='<Override PartName="/xl/worksheets/sheet'+(r+1).toString()+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />';this.sharedStringCount>0&&(e+='<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" />'),this.addToArchive(e+t+"</Types>","[Content_Types].xml")},e.prototype.addToArchive=function(e,o){if("string"==typeof e){var r=new Blob([e],{type:"text/plain"}),n=new t.ZipArchiveItem(r,o);this.mArchive.addItem(n)}else{n=new t.ZipArchiveItem(e,o);this.mArchive.addItem(n)}},e.prototype.processMergeCells=function(e,t,o){if(0!==e.rowSpan||0!==e.colSpan){var r=new I;r.x=e.index,r.width=e.colSpan,r.y=t,r.height=e.rowSpan;var n=this.getCellName(r.y,r.x),i=this.getCellName(t+r.height,e.index+r.width);r.ref=n+":"+i;o.add(r);var l={x:r.x,y:r.y},s={x:e.index+r.width,y:t+r.height};this.updatedMergedCellStyles(l,s,e)}return o},e.prototype.updatedMergedCellStyles=function(e,t,o){for(var r=e.x;r<=t.x;r++)for(var n=e.y;n<=t.y;n++)this.mergedCellsStyle.set(this.getCellName(n,r),{x:r,y:n,styleIndex:o.styleIndex})},e.prototype.dateToTicks=function(e,t,o){if(e>=1&&e<=9999&&t>=1&&t<=12){var r=e-1;return 864e9*(365*r+(r/4|0)-(r/100|0)+(r/400|0)+(this.isLeapYear(e)?[0,31,60,91,121,152,182,213,244,274,305,335,366]:[0,31,59,90,120,151,181,212,243,273,304,334,365])[t-1]+o-1)}throw new Error("Not a valid date")},e.prototype.timeToTicks=function(e,t,o){if(e>=0&&e<24&&t>=0&&t<60&&o>=0&&o<60){return 1e4*(3600*e+60*t+o)*1e3}throw new Error("Not valid time")},e.prototype.isLeapYear=function(e){return e%4==0&&(e%100!=0||e%400==0)},e.prototype.toOADate=function(e){var t=0;if(0===(t=this.dateToTicks(e.getFullYear(),e.getMonth()+1,e.getDate())+this.timeToTicks(e.getHours(),e.getMinutes(),e.getSeconds())))return 0;if(t<31241376e9)throw new Error("Arg_OleAutDateInvalid");return(t-599264352e9)/1e4/864e5},e}(),R=function(){return function(){}}();e.CellStyle=r,e.Font=n,e.CellXfs=i,e.Alignment=l,e.CellStyleXfs=s,e.CellStyles=a,e.NumFmt=d,e.Border=m,e.Borders=p,e.Cell=u,e.Cells=c,e.Column=f,e.Row=v,e.Rows=g,e.Workbook=B,e.BuiltInProperties=R,e.Worksheet=S,e.HyperLink=F,e.Grouping=C,e.FreezePane=k,e.MergeCell=I,e.MergeCells=T,e.Worksheets=x,e.CsvHelper=A,e.ValueFormatter=N,e.BlobHelper=P,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-compression"),require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-compression","@syncfusion/ej2-base"],t):t(e.ej={},e.ej2Compression,e.ej2Base)}(this,function(e,t,o){"use strict";var r=function(){return function(){this.numFmtId=0,this.backColor="none",this.fontName="Calibri",this.fontSize=14,this.fontColor="#000000",this.italic=!1,this.bold=!1,this.underline=!1,this.wrapText=!1,this.hAlign="general",this.vAlign="bottom",this.indent=0,this.numberFormat="GENERAL",this.type="datetime",this.borders=new p,this.isGlobalStyle=!1}}(),n=function(){return function(){this.sz=14,this.name="Calibri",this.u=!1,this.b=!1,this.i=!1,this.color="FF000000"}}(),i=function(){return function(){}}(),l=function(){return function(){}}(),s=function(){return function(){}}(),a=function(){return function(){this.name="Normal",this.xfId=0}}(),d=function(){return function(e,t){this.numFmtId=e,this.formatCode=t}}(),m=function(){return function(e,t){this.lineStyle=e,this.color=t}}(),p=function(){return function(){this.left=new m("none","#FFFFFF"),this.right=new m("none","#FFFFFF"),this.top=new m("none","#FFFFFF"),this.bottom=new m("none","#FFFFFF"),this.all=new m("none","#FFFFFF")}}(),h=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),u=function(){return function(){}}(),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.add=function(e){for(var o=!1,r=0,n=0,i=t;n<i.length;n++){i[n].index===e.index&&(t[r]=e,o=!0),r++}o||t.push(e)},t}return h(t,e),t}(Array),f=function(){return function(){}}(),y=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),v=function(){return function(){}}(),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.add=function(e){for(var o=!1,r=0,n=0,i=t;n<i.length;n++){i[n].index===e.index&&(t[r]=e,o=!0),r++}o||t.push(e)},t}return y(t,e),t}(Array),b=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return b(t,e),t}(Array),w=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),S=function(){return function(){this.isSummaryRowBelow=!0,this.showGridLines=!0}}(),F=function(){return function(){}}(),C=function(){return function(){}}(),k=function(){return function(){}}(),I=function(){return function(){}}(),T=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.add=function(e){for(var r=!1,n=0,i=0,l=o;i<l.length;i++){var s=l[i];if(t.isIntersecting(s,e)){var a=new I;a.x=Math.min(s.x,e.x),a.y=Math.min(s.Y,e.y),a.width=Math.max(s.Width+s.X,e.width+e.x),a.height=Math.max(s.Height+s.Y,e.height+e.y),a.ref=o[n].ref.split(":")[0]+":"+e.ref.split(":")[1],o[n]=a,e=a,r=!0}n++}return r||o.push(e),e},o}return w(t,e),t.isIntersecting=function(e,t){return e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height},t}(Array),N=function(){function e(e){this.intl=new o.Internationalization}return e.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},e.prototype.toView=function(e,t){var r=e;return o.isNullOrUndefined(t)||o.isNullOrUndefined(e)||(r=t(e)),r},e.prototype.displayText=function(e,t){return this.toView(e,this.getFormatFunction(t))},e}(),A=function(){function e(e){if(this.csvStr="",this.formatter=new N,this.isMicrosoftBrowser=!!navigator.msSaveBlob,null!==e.styles&&void 0!==e.styles){this.globalStyles=new Map;for(var t=0;t<e.styles.length;t++)void 0!==e.styles[t].name&&void 0!==e.styles[t].numberFormat&&this.globalStyles.set(e.styles[t].name,e.styles[t].numberFormat)}null!==e.worksheets&&void 0!==e.worksheets&&this.parseWorksheet(e.worksheets[0])}return e.prototype.parseWorksheet=function(e){null!==e.rows&&void 0!==e.rows&&this.parseRows(e.rows)},e.prototype.parseRows=function(e){for(var t=1,o=0,r=e;o<r.length;o++){var n=r[o];if(null===n.index||void 0===n.index)throw Error("Row index is missing.");for(;t<n.index;)this.csvStr+="\n",t++;this.parseRow(n)}},e.prototype.parseRow=function(e){if(null!==e.cells&&void 0!==e.cells)for(var t=1,o=0,r=e.cells;o<r.length;o++){var n=r[o];if(null===n.index||void 0===n.index)throw Error("Cell index is missing.");for(;t<n.index;)this.csvStr+=",",t++;this.parseCell(n)}},e.prototype.parseCell=function(e){var t=this.csvStr;void 0!==e.value&&(e.value instanceof Date?void 0!==e.style&&void 0!==e.style.numberFormat?t+=this.parseCellValue(this.formatter.displayText(e.value,{type:"dateTime",skeleton:e.style.numberFormat})):void 0!==e.style&&void 0!==e.style.name&&this.globalStyles.has(e.style.name)?t+=this.parseCellValue(this.formatter.displayText(e.value,{type:"dateTime",skeleton:this.globalStyles.get(e.style.name)})):t+=e.value:"boolean"==typeof e.value?t+=e.value?"TRUE":"FALSE":"number"==typeof e.value?void 0!==e.style&&void 0!==e.style.numberFormat?t+=this.parseCellValue(this.formatter.displayText(e.value,{format:e.style.numberFormat})):void 0!==e.style&&void 0!==e.style.name&&this.globalStyles.has(e.style.name)?t+=this.parseCellValue(this.formatter.displayText(e.value,{format:this.globalStyles.get(e.style.name)})):t+=e.value:t+=this.parseCellValue(e.value)),this.csvStr=t},e.prototype.parseCellValue=function(e){return-1!==e.indexOf(",")?e='"'+e+'"':e},e.prototype.save=function(e){if(this.buffer=new Blob(["\ufeff"+this.csvStr],{type:"text/csv;charset=UTF-8"}),this.isMicrosoftBrowser)navigator.msSaveBlob(this.buffer,e);else{var t=window.URL.createObjectURL(this.buffer),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.download=e,o.href=t;var r=document.createEvent("MouseEvent");r.initEvent("click",!0,!0),o.dispatchEvent(r),setTimeout(function(){window.URL.revokeObjectURL(t)})}},e.prototype.saveAsBlob=function(){return new Blob(["\ufeff"+this.csvStr],{type:"text/csv;charset=UTF-8"})},e}(),P=function(){function e(){this.parts=[]}return e.prototype.append=function(e){this.parts.push(e),this.blob=void 0},e.prototype.getBlob=function(){return new Blob(this.parts,{type:"text/plain"})},e}(),B=function(){function e(e,i,l,s){if(this.sharedStringCount=0,this.unitsProportions=[1.28,.32,96,96/25.4,96/2.54,1,96/72,96/72/12700],this.hyperlinkStyle={fontColor:"#0000FF",underline:!0},this.culture=void 0!==l?l:"en-US",this.currency=void 0!==s?s:"USD",this.intl=new o.Internationalization(this.culture),this.mSaveType=i,"xlsx"===i){if(this.mArchive=new t.ZipArchive,this.sharedString=[],this.mFonts=[],this.mBorders=[],this.mStyles=[],this.printTitles=new Map,this.cellStyles=new Map,this.mNumFmt=new Map,this.mFills=new Map,this.mStyles.push(new r),this.mFonts.push(new n),this.cellStyles.set("Normal",new a),this.mCellXfs=[],this.mCellStyleXfs=[],null!==e.styles&&void 0!==e.styles){this.globalStyles=new Map;for(var d=0;d<e.styles.length;d++)if(void 0!==e.styles[d].name){if(this.cellStyles.has(e.styles[d].name))throw Error("Style name "+e.styles[d].name+" is already existed");var m=new r;m.isGlobalStyle=!0,this.parserCellStyle(e.styles[d],m,"none");var p=new a;p.name=m.name,p.xfId=m.index-1,this.cellStyles.set(p.name,p);var h={};void 0!==e.styles[d].numberFormat&&(h.format=e.styles[d].numberFormat),void 0!==e.styles[d].type?h.type=e.styles[d].type:h.type="datetime",void 0!==h.format&&this.globalStyles.set(e.styles[d].name,h)}}if(null===e.worksheets||void 0===e.worksheets)throw Error("Worksheet is expected.");this.parserWorksheets(e.worksheets),null!==e.builtInProperties&&void 0!==e.builtInProperties&&(this.builtInProperties=new R,this.parserBuiltInProperties(e.builtInProperties,this.builtInProperties))}else this.csvHelper=new A(e)}return e.prototype.parserBuiltInProperties=function(e,t){null!==e.author&&void 0!==e.author&&(t.author=e.author),null!==e.comments&&void 0!==e.comments&&(t.comments=e.comments),null!==e.category&&void 0!==e.category&&(t.category=e.category),null!==e.company&&void 0!==e.company&&(t.company=e.company),null!==e.manager&&void 0!==e.manager&&(t.manager=e.manager),null!==e.subject&&void 0!==e.subject&&(t.subject=e.subject),null!==e.title&&void 0!==e.title&&(t.title=e.title),null!==e.createdDate&&void 0!==e.createdDate&&(t.createdDate=e.createdDate),null!==e.modifiedDate&&void 0!==e.modifiedDate&&(t.modifiedDate=e.modifiedDate),null!==e.tags&&void 0!==e.tags&&(t.tags=e.tags),null!==e.status&&void 0!==e.status&&(t.status=e.status)},e.prototype.parserWorksheets=function(e){this.worksheets=new x;for(var t=e.length,o=0;o<t;o++){var r=e[o],n=new S;this.mergeCells=new T,this.mergedCellsStyle=new Map,this.mHyperLinks=[],null!==r.name&&void 0!==r.name?n.name=r.name:n.name="Sheet"+(o+1).toString(),n.index=o+1,null!==r.columns&&void 0!==r.columns&&this.parserColumns(r.columns,n),null!==r.rows&&void 0!==r.rows&&this.parserRows(r.rows,n),null!==r.showGridLines&&void 0!==r.showGridLines&&(n.showGridLines=r.showGridLines),null!==r.freeze&&void 0!==r.freeze&&this.parserFreezePanes(r.freeze,n),null!==r.printTitle&&void 0!==r.printTitle&&this.parserPrintTitle(r.printTitle,n),void 0!==r.pageSetup&&void 0!==r.pageSetup.isSummaryRowBelow&&(n.isSummaryRowBelow=r.pageSetup.isSummaryRowBelow),n.index=o+1,n.mergeCells=this.mergeCells,n.hyperLinks=this.mHyperLinks,this.worksheets.push(n)}},e.prototype.mergeOptions=function(e,t){var o={};return this.applyProperties(e,o),this.applyProperties(t,o),o},e.prototype.applyProperties=function(e,t){for(var o=Object.keys(e),r=0;r<o.length;r++)"name"!==o[r]&&(t[o[r]]=e[o[r]])},e.prototype.getCellName=function(e,t){return this.getColumnName(t)+e.toString()},e.prototype.getColumnName=function(e){e--;var t="";do{var o=e%26;e=e/26-1,t=String.fromCharCode(65+o)+t}while(e>=0);return t},e.prototype.parserPrintTitle=function(e,t){var o,r="";if(null!==e.fromRow&&void 0!==e.fromRow){o="$"+e.fromRow+":$"+(null!==e.toRow&&void 0!==e.toRow?e.toRow:e.fromRow)}var n;if(null!==e.fromColumn&&void 0!==e.fromColumn){var i=e.fromColumn,l=void 0;l=null!==e.toColumn&&void 0!==e.toColumn?e.toColumn:e.fromColumn,n="$"+this.getColumnName(i)+":$"+this.getColumnName(l)}void 0!==o&&(r+=t.name+"!"+o),void 0!==n&&void 0!==o?r+=","+t.name+"!"+n:void 0!==n&&(r+=t.name+"!"+n),""!==r&&this.printTitles.set(t.index-1,r)},e.prototype.parserFreezePanes=function(e,t){t.freezePanes=new k,null!==e.row&&void 0!==e.row?t.freezePanes.row=e.row:t.freezePanes.row=0,null!==e.column&&void 0!==e.column?t.freezePanes.column=e.column:t.freezePanes.column=0,t.freezePanes.leftCell=this.getCellName(t.freezePanes.row+1,t.freezePanes.column+1)},e.prototype.parserColumns=function(e,t){var o=e.length;t.columns=[];for(var r=0;r<o;r++){var n=new f;if(null===e[r].index||void 0===e[r].index)throw Error("Column index is missing.");n.index=e[r].index,null!==e[r].width&&void 0!==e[r].width&&(n.width=e[r].width),t.columns.push(n)}},e.prototype.parserRows=function(e,t){var o=e.length;t.rows=new g;for(var r=0,n=0;n<o;n++){var i=this.parserRow(e[n],r);r=i.index,t.rows.add(i)}this.insertMergedCellsStyle(t)},e.prototype.insertMergedCellsStyle=function(e){var t=this;this.mergeCells.length>0&&this.mergedCellsStyle.forEach(function(r,n){var i=e.rows.filter(function(e){return e.index===r.y})[0];if(o.isNullOrUndefined(i)){var l=e.rows.filter(function(e){return e.index<=r.y}),s=new v;s.index=r.y,s.cells=new c,s.cells.add(t.createCell(r,n));m=0;l.length>0&&(m=e.rows.indexOf(l[l.length-1])+1),e.rows.splice(m,0,s)}else{var a=i.cells.filter(function(e){return e.index===r.x})[0];if(o.isNullOrUndefined(a)){var d=i.cells.filter(function(e){return e.index<=r.x}),m=0;d.length>0&&(m=i.cells.indexOf(d[d.length-1])+1),i.cells.splice(m,0,t.createCell(r,n))}else a.styleIndex=r.styleIndex}})},e.prototype.createCell=function(e,t){var o=new u;return o.refName=t,o.index=e.x,o.cellStyle=new r,o.styleIndex=e.styleIndex,o},e.prototype.parserRow=function(e,t){var o=new v;if(null!==e.height&&void 0!==e.height&&(o.height=e.height),null===e.index||void 0===e.index)throw Error("Row index is missing.");return o.index=e.index,null!==e.grouping&&void 0!==e.grouping&&this.parseGrouping(e.grouping,o),this.parseCells(e.cells,o),o},e.prototype.parseGrouping=function(e,t){t.grouping=new C,void 0!==e.outlineLevel&&(t.grouping.outlineLevel=e.outlineLevel),void 0!==e.isCollapsed&&(t.grouping.isCollapsed=e.isCollapsed),void 0!==e.isHidden&&(t.grouping.isHidden=e.isHidden)},e.prototype.parseCells=function(e,t){t.cells=new c;for(var o=void 0!==e?e.length:0,n=1,i=1,l=0;l<o;l++){var s=e[l],a=new u;if(null===s.index||void 0===s.index)throw Error("Cell index is missing.");if(a.index=s.index,a.index<n?n=a.index:a.index>i&&(i=a.index),a.refName=this.getCellName(t.index,a.index),null!==s.rowSpan&&void 0!==s.rowSpan?a.rowSpan=s.rowSpan-1:a.rowSpan=0,null!==s.colSpan&&void 0!==s.colSpan?a.colSpan=s.colSpan-1:a.colSpan=0,null!==s.hyperlink&&void 0!==s.hyperlink){var d=new F;void 0!==s.hyperlink.target&&(d.target=s.hyperlink.target,void 0!==s.hyperlink.displayText?a.value=s.hyperlink.displayText:a.value=s.hyperlink.target,a.type=this.getCellValueType(a.value),d.ref=a.refName,d.rId=this.mHyperLinks.length+1,this.mHyperLinks.push(d),a.cellStyle=new r,this.parserCellStyle(void 0!==s.style?this.mergeOptions(s.style,this.hyperlinkStyle):this.hyperlinkStyle,a.cellStyle,"string"),a.styleIndex=a.cellStyle.index)}null!==s.value&&void 0!==s.value&&(a.value=s.value,a.type=this.getCellValueType(a.value)),null!==s.style&&void 0!==s.style&&void 0===a.styleIndex?(a.cellStyle=new r,a.value instanceof Date?this.parserCellStyle(s.style,a.cellStyle,a.type,14):this.parserCellStyle(s.style,a.cellStyle,a.type),a.styleIndex=a.cellStyle.index):a.value instanceof Date&&(a.cellStyle=new r,this.parserCellStyle({},a.cellStyle,a.type,14),a.styleIndex=a.cellStyle.index),this.parseCellType(a),this.mergeCells=this.processMergeCells(a,t.index,this.mergeCells),t.cells.add(a)}t.spans=n+":"+i},e.prototype.applyGlobalStyle=function(e,t){this.cellStyles.has(e.name)&&(t.index=this.mStyles.filter(function(t){return t.name===e.name})[0].index,t.name=e.name)},e.prototype.parserCellStyle=function(e,t,o,r){if(null!==e.name&&void 0!==e.name){if(!t.isGlobalStyle)return void this.applyGlobalStyle(e,t);t.name=e.name}null!==e.backColor&&void 0!==e.backColor&&(t.backColor=e.backColor),t.borders=new p,null!==e.borders&&void 0!==e.borders&&this.parserBorder(e.borders,t.borders.all),null!==e.leftBorder&&void 0!==e.leftBorder&&this.parserBorder(e.leftBorder,t.borders.left),null!==e.rightBorder&&void 0!==e.rightBorder&&this.parserBorder(e.rightBorder,t.borders.right),null!==e.topBorder&&void 0!==e.topBorder&&this.parserBorder(e.topBorder,t.borders.top),null!==e.bottomBorder&&void 0!==e.bottomBorder&&this.parserBorder(e.bottomBorder,t.borders.bottom),null!==e.fontName&&void 0!==e.fontName&&(t.fontName=e.fontName),null!==e.fontSize&&void 0!==e.fontSize&&(t.fontSize=e.fontSize),null!==e.fontColor&&void 0!==e.fontColor&&(t.fontColor=e.fontColor),null!==e.italic&&void 0!==e.italic&&(t.italic=e.italic),null!==e.bold&&void 0!==e.bold&&(t.bold=e.bold),null!==e.hAlign&&void 0!==e.hAlign&&(t.hAlign=e.hAlign),null!==e.indent&&void 0!==e.indent&&(t.indent=e.indent,"left"!==t.hAlign&&"right"!==t.hAlign&&(t.hAlign="left")),null!==e.vAlign&&void 0!==e.vAlign&&(t.vAlign=e.vAlign),null!==e.underline&&void 0!==e.underline&&(t.underline=e.underline),null!==e.wrapText&&void 0!==e.wrapText&&(t.wrapText=e.wrapText),null!==e.numberFormat&&void 0!==e.numberFormat?null!==e.type&&void 0!==e.type?t.numberFormat=this.getNumberFormat(e.numberFormat,e.type):t.numberFormat=this.getNumberFormat(e.numberFormat,o):void 0!==r?(t.numFmtId=14,t.numberFormat="GENERAL"):t.numberFormat="GENERAL",t.index=this.processCellStyle(t)},e.prototype.switchNumberFormat=function(e,t){var o=this.getNumberFormat(e,t);if(o!==e){var r=this.mNumFmt.get(e);if(void 0!==r&&(r.formatCode=o,this.mNumFmt.has(o))){for(var n=0,i=this.mCellStyleXfs;n<i.length;n++){var l=i[n];l.numFmtId===r.numFmtId&&(l.numFmtId=this.mNumFmt.get(o).numFmtId)}for(var s=0,a=this.mCellXfs;s<a.length;s++){var d=a[s];d.numFmtId===r.numFmtId&&(d.numFmtId=this.mNumFmt.get(o).numFmtId)}}}},e.prototype.getNumberFormat=function(e,t){var o;switch(t){case"number":try{o=this.intl.getNumberPattern({format:e,currency:this.currency})}catch(t){o=e}break;case"datetime":try{o=this.intl.getDatePattern({skeleton:e,type:"dateTime"},!0)}catch(t){o=e}break;case"date":try{o=this.intl.getDatePattern({skeleton:e,type:"date"},!0)}catch(t){o=e}break;case"time":try{o=this.intl.getDatePattern({skeleton:e,type:"time"},!0)}catch(t){o=e}break;default:o=e}return o},e.prototype.parserBorder=function(e,t){null!==e.color&&void 0!==e.color?t.color=e.color:t.color="#000000",null!==e.lineStyle&&void 0!==e.lineStyle?t.lineStyle=e.lineStyle:t.lineStyle="thin"},e.prototype.processCellStyle=function(e){if(e.isGlobalStyle)return this.processNumFormatId(e),this.mStyles.push(e),this.mStyles.length;var t=this.compareStyle(e);return t.result?t.index:(this.processNumFormatId(e),this.mStyles.push(e),this.mStyles.length)},e.prototype.processNumFormatId=function(e){if("GENERAL"!==e.numberFormat&&!this.mNumFmt.has(e.numberFormat)){var t=this.mNumFmt.size+164;this.mNumFmt.set(e.numberFormat,new d(t,e.numberFormat))}},e.prototype.isNewFont=function(e){for(var t=!1,o=0,r=0,n=this.mFonts;r<n.length;r++){var i=n[r];o++;var l=void 0;if(void 0!==e.fontColor&&(l="FF"+e.fontColor.replace("#","")),t=i.color===l&&i.b===e.bold&&i.i===e.italic&&i.u===e.underline&&i.name===e.fontName&&i.sz===e.fontSize)break}return o-=1,{index:o,result:t}},e.prototype.isNewBorder=function(e){var t=new r;return this.isAllBorder(e.borders)?t.borders.all.color===e.borders.all.color&&t.borders.all.lineStyle===e.borders.all.lineStyle:t.borders.left.color===e.borders.left.color&&t.borders.left.lineStyle===e.borders.left.lineStyle&&t.borders.right.color===e.borders.right.color&&t.borders.right.lineStyle===e.borders.right.lineStyle&&t.borders.top.color===e.borders.top.color&&t.borders.top.lineStyle===e.borders.top.lineStyle&&t.borders.bottom.color===e.borders.bottom.color&&t.borders.bottom.lineStyle===e.borders.bottom.lineStyle},e.prototype.isAllBorder=function(e){var t=new r;return t.borders.all.color!==e.all.color&&t.borders.all.lineStyle!==e.all.lineStyle},e.prototype.compareStyle=function(e){for(var t=!0,o=0,r=0,n=this.mStyles;r<n.length;r++){var i=n[r];if(t=!i.isGlobalStyle&&(i.backColor===e.backColor&&i.bold===e.bold&&i.numFmtId===e.numFmtId&&i.numberFormat===e.numberFormat&&i.type===e.type&&i.fontColor===e.fontColor&&i.fontName===e.fontName&&i.fontSize===e.fontSize&&i.hAlign===e.hAlign&&i.italic===e.italic&&i.underline===e.underline&&i.vAlign===e.vAlign&&i.indent===e.indent&&i.wrapText===e.wrapText&&i.borders.all.color===e.borders.all.color&&i.borders.all.lineStyle===e.borders.all.lineStyle&&i.borders.left.color===e.borders.left.color&&i.borders.left.lineStyle===e.borders.left.lineStyle&&i.borders.right.color===e.borders.right.color&&i.borders.right.lineStyle===e.borders.right.lineStyle&&i.borders.top.color===e.borders.top.color&&i.borders.top.lineStyle===e.borders.top.lineStyle&&i.borders.bottom.color===e.borders.bottom.color&&i.borders.bottom.lineStyle===e.borders.bottom.lineStyle)){o=i.index;break}}return{index:o,result:t}},e.prototype.contains=function(e,t){var o=e.indexOf(t);return o>-1&&o<e.length},e.prototype.getCellValueType=function(e){return e instanceof Date?"datetime":"boolean"==typeof e?"boolean":"number"==typeof e?"number":"string"},e.prototype.parseCellType=function(e){var t,o=e.type,r=e.value;switch(o){case"datetime":if(r=this.toOADate(r),void 0!==e.cellStyle&&void 0!==e.cellStyle.name&&this.globalStyles.has(e.cellStyle.name)){var n=this.globalStyles.get(e.cellStyle.name);this.switchNumberFormat(n.format,n.type)}t="n";break;case"boolean":r=r?1:0,t="b";break;case"number":t="n",void 0!==e.cellStyle&&void 0!==e.cellStyle.name&&this.globalStyles.has(e.cellStyle.name)&&this.switchNumberFormat(this.globalStyles.get(e.cellStyle.name).format,"number");break;case"string":this.sharedStringCount++,t="s",this.contains(this.sharedString,r)||this.sharedString.push(r),r=this.sharedString.indexOf(r)}e.saveType=t,e.value=r},e.prototype.saveAsBlob=function(e){var t=this;switch(e){case"text/csv":return new Promise(function(e,o){var r={};r.blobData=t.csvHelper.saveAsBlob(),e(r)});default:return new Promise(function(e,o){t.saveInternal(),t.mArchive.saveAsBlob().then(function(t){var o={};o.blobData=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),e(o)})})}},e.prototype.save=function(e,t){var o=this;if(null===e||void 0===e||""===e)throw new Error("Argument Null Exception: fileName cannot be null or empty");var r=e.match(".xlsx$"),n=e.match(".csv$");if(null!==r&&r[0]==="."+this.mSaveType)this.saveInternal(),this.mArchive.save(e).then(function(){o.mArchive.destroy()});else{if(null===n||n[0]!=="."+this.mSaveType)throw Error("Save type and file extension is different.");this.csvHelper.save(e)}},e.prototype.saveInternal=function(){this.saveWorkbook(),this.saveWorksheets(),this.saveSharedString(),this.saveStyles(),this.saveApp(this.builtInProperties),this.saveCore(this.builtInProperties),this.saveContentType(),this.saveTopLevelRelation(),this.saveWorkbookRelation()},e.prototype.saveWorkbook=function(){for(var e='<?xml version="1.0" encoding="utf-8"?><workbook xmlns:r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns= "http://schemas.openxmlformats.org/spreadsheetml/2006/main"><workbookPr codeName="ThisWorkbook" defaultThemeVersion= "153222"/><bookViews><workbookView activeTab="0"/></bookViews>',t="<sheets>",o=this.worksheets.length,r=0;r<o;r++)t+='<sheet name="'+this.worksheets[r].name+'" sheetId="'+(r+1).toString()+'" r:id ="rId'+(r+1).toString()+'" />';if(t+="</sheets>",e+=t,this.printTitles.size>0){var n="<definedNames>";this.printTitles.forEach(function(e,t){n+='<definedName name="_xlnm.Print_Titles" localSheetId="'+t+'">'+e+"</definedName>"}),e+=n+="</definedNames>"}this.addToArchive(e+"</workbook>","xl/workbook.xml")},e.prototype.saveWorksheets=function(){for(var e=this.worksheets.length,t=0;t<e;t++)this.saveWorksheet(this.worksheets[t],t)},e.prototype.saveWorksheet=function(e,t){var r=new P,n='<?xml version="1.0" encoding="utf-8" standalone="yes"?><worksheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';if(e.isSummaryRowBelow?n+="<sheetPr />":n+='<sheetPr><outlinePr summaryBelow="0" ></outlinePr></sheetPr>',n+=this.saveSheetView(e),void 0!==e.columns){for(var i="<cols>",l=0,s=e.columns;l<s.length;l++){var a=s[l];void 0!==a.width?i+='<col min="'+a.index+'" max="'+a.index+'" width="'+this.pixelsToColumnWidth(a.width)+'" customWidth="1" />':i+='<col min="'+a.index+'" max="'+a.index+'" width="8.43" customWidth="1" />'}n+=i+"</cols>"}if(n+="<sheetData>",r.append(n),n="",void 0!==e.rows)for(var d=0,m=e.rows;d<m.length;d++){var p=m[d],h='<row r="'+p.index+'" ';o.isNullOrUndefined(p.spans)||(h+='spans="'+p.spans+'" '),void 0!==p.height&&(h+='ht="'+this.pixelsToRowHeight(p.height)+'" customHeight="1" '),void 0!==p.grouping&&(p.grouping.isHidden&&(h+='hidden="1" '),void 0!==p.grouping.outlineLevel&&(h+='outlineLevel="'+p.grouping.outlineLevel+'" '),p.grouping.isCollapsed&&(h+='collapsed="1" ')),h+=">";for(var u=0,c=p.cells;u<c.length;u++){var f=c[u];void 0===f||void 0===f.value&&void 0===f.cellStyle||(h+='<c r="'+f.refName+'" ',void 0!==f.saveType&&(h+='t="'+f.saveType+'" '),void 0!==f.styleIndex&&(h+='s="'+f.styleIndex+'" '),h+=" >",void 0!==f.value?h+="<v>"+f.value+"</v></c>":h+="</c>")}h+="</row>",r.append(h)}if(n+="</sheetData>",e.mergeCells.length>0){n+='<mergeCells count="'+e.mergeCells.length+'">';for(var y=0,v=e.mergeCells;y<v.length;y++){n+='<mergeCell ref="'+v[y].ref+'" />'}n+="</mergeCells>"}if(e.hyperLinks.length>0){n+="<hyperlinks>";for(var g=0,b=e.hyperLinks;g<b.length;g++){var x=b[g];n+='<hyperlink ref="'+x.ref+'" r:id="rId'+x.rId+'" />'}n+="</hyperlinks>",this.addToArchive(this.saveSheetRelations(e),"xl/worksheets/_rels/sheet"+e.index+".xml.rels")}n+='<pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5" /><headerFooter scaleWithDoc="1" alignWithMargins="0" differentFirst="0" differentOddEven="0" /></worksheet>',r.append(n),this.addToArchive(r.getBlob(),"xl/worksheets/sheet"+(t+1)+".xml")},e.prototype.pixelsToColumnWidth=function(e){var t=e>12?this.trunc((e-5)/7*100+.5)/100:e/12;return t>1?(7*t+5)/7*256/256:12*t/7*256/256},e.prototype.trunc=function(e){var t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t},e.prototype.pixelsToRowHeight=function(e){return e*this.unitsProportions[5]/this.unitsProportions[6]},e.prototype.saveSheetRelations=function(e){for(var t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',o=0,r=e.hyperLinks;o<r.length;o++){var n=r[o];t+='<Relationship Id="rId'+n.rId+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="'+n.target+'" TargetMode="External" />'}return t+="</Relationships>"},e.prototype.saveSheetView=function(e){var t='<sheetViews><sheetView workbookViewId="0" ';return!1===e.showGridLines?t+='showGridLines="0" >':t+=">",void 0!==e.freezePanes&&(t+='<pane state="frozen" topLeftCell="'+e.freezePanes.leftCell+'" ',0!==e.freezePanes.row&&(t+='ySplit="'+e.freezePanes.row+'" '),0!==e.freezePanes.column&&(t+='xSplit="'+e.freezePanes.column+'" '),t+="/>"),t+="</sheetView></sheetViews > "},e.prototype.saveSharedString=function(){var e=this.sharedString.length;if(e>0){for(var t='<?xml version="1.0" encoding="utf-8"?><sst uniqueCount="'+e+'" count="'+this.sharedStringCount+'" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">',o="",r=0;r<e;r++)o+="<si><t>",o+=this.processString(this.sharedString[r]),o+="</t></si>";o+="</sst>",this.addToArchive(t+o,"xl/sharedStrings.xml")}},e.prototype.processString=function(e){return-1!==e.indexOf("&")&&(e=e.replace(/&/g,"&amp;")),-1!==e.indexOf("<")&&(e=e.replace(/</g,"&lt;")),-1!==e.indexOf(">")&&(e=e.replace(/>/g,"&gt;")),e},e.prototype.saveStyles=function(){this.updateCellXfsStyleXfs();var e='<?xml version="1.0" encoding="utf-8"?><styleSheet xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';e+=this.saveNumberFormats(),e+=this.saveFonts(),e+=this.saveFills(),e+=this.saveBorders(),e+=this.saveCellStyleXfs(),e+=this.saveCellXfs(),e+=this.saveCellStyles(),this.addToArchive(e+"</styleSheet>","xl/styles.xml")},e.prototype.updateCellXfsStyleXfs=function(){for(var e=0,t=this.mStyles;e<t.length;e++){var o=t[e],r=void 0;o.isGlobalStyle?(r=new s).xfId=o.index-1:(r=new i).xfId=0;var a=this.isNewFont(o);if(a.result)r.fontId=a.index;else{var m=new n;m.b=o.bold,m.i=o.italic,m.name=o.fontName,m.sz=o.fontSize,m.u=o.underline,m.color="FF"+o.fontColor.replace("#",""),this.mFonts.push(m),r.fontId=this.mFonts.length-1}if("none"!==o.backColor){var p="FF"+o.backColor.replace("#","");if(this.mFills.has(p)){var h=this.mFills.get(p);r.fillId=h}else{h=this.mFills.size+2;this.mFills.set(p,h),r.fillId=h}}else r.fillId=0;if(this.isNewBorder(o)?r.borderId=0:(this.mBorders.push(o.borders),r.borderId=this.mBorders.length),"GENERAL"!==o.numberFormat)if(this.mNumFmt.has(o.numberFormat)){var u=this.mNumFmt.get(o.numberFormat);r.numFmtId=u.numFmtId}else{var c=this.mNumFmt.size+164;this.mNumFmt.set(o.numberFormat,new d(c,o.numberFormat)),r.numFmtId=c}else"GENERAL"===o.numberFormat&&14===o.numFmtId?r.numFmtId=14:r.numFmtId=0;o.isGlobalStyle||(r.applyAlignment=1),r.alignment=new l,r.alignment.indent=o.indent,r.alignment.horizontal=o.hAlign,r.alignment.vertical=o.vAlign,r.alignment.wrapText=o.wrapText?1:0,o.isGlobalStyle?(this.mCellStyleXfs.push(r),this.mCellXfs.push(r)):this.mCellXfs.push(r)}},e.prototype.saveNumberFormats=function(){if(this.mNumFmt.size>=1){var e='<numFmts count="'+this.mNumFmt.size+'">';return this.mNumFmt.forEach(function(t,o){e+='<numFmt numFmtId="'+t.numFmtId+'" formatCode="'+t.formatCode.replace(/"/g,"&quot;")+'" />'}),e+="</numFmts>"}return""},e.prototype.saveFonts=function(){var e='<fonts count="'+this.mFonts.length+'">';if(this.mFonts.length>=1)for(var t=0,o=this.mFonts;t<o.length;t++){var r=o[t];e+="<font>",r.b&&(e+="<b />"),r.i&&(e+="<i />"),r.u&&(e+="<u />"),e+='<sz val="'+this.pixelsToRowHeight(r.sz)+'" />',e+='<color rgb="'+r.color+'" />',e+='<name val="'+r.name+'" /></font>'}return e+"</fonts>"},e.prototype.saveFills=function(){var e='<fills count="'+(this.mFills.size+2)+'"><fill><patternFill patternType="none"></patternFill></fill><fill><patternFill patternType="gray125"></patternFill></fill>';return this.mFills.size>=1&&this.mFills.forEach(function(t,o){e+='<fill><patternFill patternType="solid"><fgColor rgb="'+o+'" /><bgColor rgb="FFFFFFFF" /></patternFill></fill>'}),e+"</fills>"},e.prototype.saveBorders=function(){var e='<borders count="'+(this.mBorders.length+1)+'"><border><left /><right /><top /><bottom /><diagonal /></border>';if(this.mBorders.length>=1)for(var t=0,o=this.mBorders;t<o.length;t++){var r=o[t];if(this.isAllBorder(r)){var n=r.all.color.replace("#",""),i=r.all.lineStyle;e+='<border><left style="'+i+'"><color rgb="FF'+n+'" /></left><right style="'+i+'"><color rgb="FF'+n+'" /></right><top style="'+i+'"><color rgb="FF'+n+'" /></top><bottom style="'+i+'"><color rgb="FF'+n+'" /></bottom></border>'}else e+='<border><left style="'+r.left.lineStyle+'"><color rgb="FF'+r.left.color.replace("#","")+'" /></left><right style="'+r.right.lineStyle+'"><color rgb="FF'+r.right.color.replace("#","")+'" /></right><top style="'+r.top.lineStyle+'"><color rgb="FF'+r.top.color.replace("#","")+'" /></top><bottom style="'+r.bottom.lineStyle+'"><color rgb="FF'+r.bottom.color.replace("#","")+'" /></bottom></border>'}return e+"</borders>"},e.prototype.saveCellStyles=function(){var e=this,t='<cellStyles count="'+this.cellStyles.size+'">';return this.cellStyles.forEach(function(o,r){t+='<cellStyle name="'+r+'" xfId="'+e.cellStyles.get(r).xfId+'"',"Normal"===r&&(t+=' builtinId="0"'),t+=" />"}),t+="</cellStyles>"},e.prototype.saveCellStyleXfs=function(){var e='<cellStyleXfs count="'+(this.mCellStyleXfs.length+1)+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" />';if(this.mCellStyleXfs.length>=1)for(var t=0,o=this.mCellStyleXfs;t<o.length;t++){var r=o[t];e+='<xf numFmtId="'+r.numFmtId+'" fontId="'+r.fontId+'" fillId="'+r.fillId+'" borderId="'+r.borderId+'" ',void 0!==r.alignment?e+=">"+this.saveAlignment(r)+"</xf>":e+=" />"}return e+"</cellStyleXfs>"},e.prototype.saveCellXfs=function(){var e='<cellXfs count="'+(this.mCellXfs.length+1)+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />';if(this.mCellXfs.length>=1)for(var t=0,o=this.mCellXfs;t<o.length;t++){var r=o[t];e+='<xf numFmtId="'+r.numFmtId+'" fontId="'+r.fontId+'" fillId="'+r.fillId+'" borderId="'+r.borderId+'" xfId="'+r.xfId+'" ',1===r.applyAlignment&&(e+='applyAlignment="1"'),e+=">"+this.saveAlignment(r)+"</xf>"}return e+"</cellXfs>"},e.prototype.saveAlignment=function(e){var t="<alignment ";return void 0!==e.alignment.horizontal&&(t+='horizontal="'+e.alignment.horizontal+'" '),void 0!==e.alignment.indent&&(t+='indent="'+e.alignment.indent+'" '),void 0!==e.alignment.vertical&&(t+='vertical="'+e.alignment.vertical+'" '),t+='wrapText="'+e.alignment.wrapText+'" />'},e.prototype.saveApp=function(e){var t='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>Essential XlsIO</Application>';void 0!==e&&(void 0!==e.manager&&(t+="<Manager>"+e.manager+"</Manager>"),void 0!==e.company&&(t+="<Company>"+e.company+"</Company>")),this.addToArchive(t+"</Properties>","docProps/app.xml")},e.prototype.saveCore=function(e){var t=new Date,o='<?xml version="1.0" encoding="utf-8" standalone="yes"?><cp:coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">';void 0!==this.builtInProperties?(void 0!==e.author&&(o+="<dc:creator>"+e.author+"</dc:creator>"),void 0!==e.subject&&(o+="<dc:subject>"+e.subject+"</dc:subject>"),void 0!==e.category&&(o+="<cp:category>"+e.category+"</cp:category>"),void 0!==e.comments&&(o+="<dc:description>"+e.comments+"</dc:description>"),void 0!==e.title&&(o+="<dc:title>"+e.title+"</dc:title>"),void 0!==e.tags&&(o+="<cp:keywords>"+e.tags+"</cp:keywords>"),void 0!==e.status&&(o+="<cp:contentStatus>"+e.status+"</cp:contentStatus>"),void 0!==e.createdDate?o+='<dcterms:created xsi:type="dcterms:W3CDTF">'+e.createdDate.toISOString()+"</dcterms:created>":o+='<dcterms:created xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:created>",void 0!==e.modifiedDate?o+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+e.modifiedDate.toISOString()+"</dcterms:modified>":o+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:modified>"):(o+='<dcterms:created xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:created>",o+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:modified>"),o+="</cp:coreProperties>",this.addToArchive(o,"docProps/core.xml")},e.prototype.saveTopLevelRelation=function(){this.addToArchive('<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml" /><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" /><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" /></Relationships>',"_rels/.rels")},e.prototype.saveWorkbookRelation=function(){for(var e='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',t=this.worksheets.length,o=0,r=0;r<t;r++,o++)e+='<Relationship Id="rId'+(r+1).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(r+1).toString()+'.xml" />';e+='<Relationship Id="rId'+(++o).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />',this.sharedStringCount>0&&(e+='<Relationship Id="rId'+(++o).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" />'),this.addToArchive(e+"</Relationships>","xl/_rels/workbook.xml.rels")},e.prototype.saveContentType=function(){for(var e='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />',t="",o=this.worksheets.length,r=0;r<o;r++)t+='<Override PartName="/xl/worksheets/sheet'+(r+1).toString()+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />';this.sharedStringCount>0&&(e+='<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" />'),this.addToArchive(e+t+"</Types>","[Content_Types].xml")},e.prototype.addToArchive=function(e,o){if("string"==typeof e){var r=new Blob([e],{type:"text/plain"}),n=new t.ZipArchiveItem(r,o);this.mArchive.addItem(n)}else{n=new t.ZipArchiveItem(e,o);this.mArchive.addItem(n)}},e.prototype.processMergeCells=function(e,t,o){if(0!==e.rowSpan||0!==e.colSpan){var r=new I;r.x=e.index,r.width=e.colSpan,r.y=t,r.height=e.rowSpan;var n=this.getCellName(r.y,r.x),i=this.getCellName(t+r.height,e.index+r.width);r.ref=n+":"+i;o.add(r);var l={x:r.x,y:r.y},s={x:e.index+r.width,y:t+r.height};this.updatedMergedCellStyles(l,s,e)}return o},e.prototype.updatedMergedCellStyles=function(e,t,o){for(var r=e.x;r<=t.x;r++)for(var n=e.y;n<=t.y;n++)this.mergedCellsStyle.set(this.getCellName(n,r),{x:r,y:n,styleIndex:o.styleIndex})},e.prototype.dateToTicks=function(e,t,o){if(e>=1&&e<=9999&&t>=1&&t<=12){var r=e-1;return 864e9*(365*r+(r/4|0)-(r/100|0)+(r/400|0)+(this.isLeapYear(e)?[0,31,60,91,121,152,182,213,244,274,305,335,366]:[0,31,59,90,120,151,181,212,243,273,304,334,365])[t-1]+o-1)}throw new Error("Not a valid date")},e.prototype.timeToTicks=function(e,t,o){if(e>=0&&e<24&&t>=0&&t<60&&o>=0&&o<60){return 1e4*(3600*e+60*t+o)*1e3}throw new Error("Not valid time")},e.prototype.isLeapYear=function(e){return e%4==0&&(e%100!=0||e%400==0)},e.prototype.toOADate=function(e){var t=0;if(0===(t=this.dateToTicks(e.getFullYear(),e.getMonth()+1,e.getDate())+this.timeToTicks(e.getHours(),e.getMinutes(),e.getSeconds())))return 0;if(t<31241376e9)throw new Error("Arg_OleAutDateInvalid");return(t-599264352e9)/1e4/864e5},e}(),R=function(){return function(){}}();e.CellStyle=r,e.Font=n,e.CellXfs=i,e.Alignment=l,e.CellStyleXfs=s,e.CellStyles=a,e.NumFmt=d,e.Border=m,e.Borders=p,e.Cell=u,e.Cells=c,e.Column=f,e.Row=v,e.Rows=g,e.Workbook=B,e.BuiltInProperties=R,e.Worksheet=S,e.HyperLink=F,e.Grouping=C,e.FreezePane=k,e.MergeCell=I,e.MergeCells=T,e.Worksheets=x,e.CsvHelper=A,e.ValueFormatter=N,e.BlobHelper=P,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-excel-export.umd.min.js.map
/*!
* filename: index.d.ts
* version : 16.3.24
* version : 16.3.29
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved.

@@ -11,9 +11,5 @@ * Use of this code is subject to the terms of our license.

import * as _excelexport from '@syncfusion/ej2-excel-export';
import * as _compression from '@syncfusion/ej2-compression';
import * as _base from '@syncfusion/ej2-base';
export declare namespace ej {
const excelexport: typeof _excelexport;
const compression: typeof _compression;
const base: typeof _base;
}

@@ -1,8 +0,4 @@

define(["require", "exports", "./src/index"], function (require, exports, index_1) {
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(index_1);
});
/**
* index
*/
export * from './src/index';
{
"name": "@syncfusion/ej2-excel-export",
"version": "16.3.24",
"version": "16.3.29",
"description": "Essential JS 2 Excel Export Library",

@@ -8,7 +8,7 @@ "author": "Syncfusion Inc.",

"main": "./dist/ej2-excel-export.umd.min.js",
"module": "./dist/es6/ej2-excel-export.es5.js",
"module": "./index.js",
"es2015": "./dist/es6/ej2-excel-export.es2015.js",
"dependencies": {
"@syncfusion/ej2-compression": "~16.3.24",
"@syncfusion/ej2-base": "~16.3.24"
"@syncfusion/ej2-compression": "~16.3.29",
"@syncfusion/ej2-base": "~16.3.29"
},

@@ -15,0 +15,0 @@ "devDependencies": {

@@ -1,18 +0,20 @@

define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var BlobHelper = (function () {
function BlobHelper() {
this.parts = [];
}
BlobHelper.prototype.append = function (part) {
this.parts.push(part);
this.blob = undefined;
};
BlobHelper.prototype.getBlob = function () {
return new Blob(this.parts, { type: 'text/plain' });
};
return BlobHelper;
}());
exports.BlobHelper = BlobHelper;
});
/**
* BlobHelper class
* @private
*/
var BlobHelper = /** @class */ (function () {
function BlobHelper() {
/* tslint:disable:no-any */
this.parts = [];
}
/* tslint:disable:no-any */
BlobHelper.prototype.append = function (part) {
this.parts.push(part);
this.blob = undefined; // Invalidate the blob
};
BlobHelper.prototype.getBlob = function () {
return new Blob(this.parts, { type: 'text/plain' });
};
return BlobHelper;
}());
export { BlobHelper };

@@ -1,91 +0,123 @@

define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var CellStyle = (function () {
function CellStyle() {
this.numFmtId = 0;
this.backColor = 'none';
this.fontName = 'Calibri';
this.fontSize = 14;
this.fontColor = '#000000';
this.italic = false;
this.bold = false;
this.underline = false;
this.wrapText = false;
this.hAlign = 'general';
this.vAlign = 'bottom';
this.indent = 0;
this.numberFormat = 'GENERAL';
this.type = 'datetime';
this.borders = new Borders();
this.isGlobalStyle = false;
}
return CellStyle;
}());
exports.CellStyle = CellStyle;
var Font = (function () {
function Font() {
this.sz = 14;
this.name = 'Calibri';
this.u = false;
this.b = false;
this.i = false;
this.color = 'FF000000';
}
return Font;
}());
exports.Font = Font;
var CellXfs = (function () {
function CellXfs() {
}
return CellXfs;
}());
exports.CellXfs = CellXfs;
var Alignment = (function () {
function Alignment() {
}
return Alignment;
}());
exports.Alignment = Alignment;
var CellStyleXfs = (function () {
function CellStyleXfs() {
}
return CellStyleXfs;
}());
exports.CellStyleXfs = CellStyleXfs;
var CellStyles = (function () {
function CellStyles() {
this.name = 'Normal';
this.xfId = 0;
}
return CellStyles;
}());
exports.CellStyles = CellStyles;
var NumFmt = (function () {
function NumFmt(id, code) {
this.numFmtId = id;
this.formatCode = code;
}
return NumFmt;
}());
exports.NumFmt = NumFmt;
var Border = (function () {
function Border(mLine, mColor) {
this.lineStyle = mLine;
this.color = mColor;
}
return Border;
}());
exports.Border = Border;
var Borders = (function () {
function Borders() {
this.left = new Border('none', '#FFFFFF');
this.right = new Border('none', '#FFFFFF');
this.top = new Border('none', '#FFFFFF');
this.bottom = new Border('none', '#FFFFFF');
this.all = new Border('none', '#FFFFFF');
}
return Borders;
}());
exports.Borders = Borders;
});
/**
* CellStyle class
* @private
*/
var CellStyle = /** @class */ (function () {
function CellStyle() {
this.numFmtId = 0;
this.backColor = 'none';
this.fontName = 'Calibri';
this.fontSize = 14;
this.fontColor = '#000000';
this.italic = false;
this.bold = false;
this.underline = false;
this.wrapText = false;
this.hAlign = 'general';
this.vAlign = 'bottom';
this.indent = 0;
this.numberFormat = 'GENERAL';
this.type = 'datetime';
this.borders = new Borders();
this.isGlobalStyle = false;
}
return CellStyle;
}());
export { CellStyle };
/**
* Font Class
* @private
*/
var Font = /** @class */ (function () {
function Font() {
this.sz = 14;
this.name = 'Calibri';
this.u = false;
this.b = false;
this.i = false;
this.color = 'FF000000';
}
return Font;
}());
export { Font };
/**
* CellXfs class
* @private
*/
var CellXfs = /** @class */ (function () {
function CellXfs() {
}
return CellXfs;
}());
export { CellXfs };
/**
* Alignment class
* @private
*/
var Alignment = /** @class */ (function () {
function Alignment() {
}
return Alignment;
}());
export { Alignment };
/**
* CellStyleXfs class
* @private
*/
var CellStyleXfs = /** @class */ (function () {
function CellStyleXfs() {
}
return CellStyleXfs;
}());
export { CellStyleXfs };
/**
* CellStyles class
* @private
*/
var CellStyles = /** @class */ (function () {
function CellStyles() {
this.name = 'Normal';
this.xfId = 0;
}
return CellStyles;
}());
export { CellStyles };
/**
* NumFmt class
* @private
*/
var NumFmt = /** @class */ (function () {
function NumFmt(id, code) {
this.numFmtId = id;
this.formatCode = code;
}
return NumFmt;
}());
export { NumFmt };
/**
* Border class
* @private
*/
var Border = /** @class */ (function () {
function Border(mLine, mColor) {
this.lineStyle = mLine;
this.color = mColor;
}
return Border;
}());
export { Border };
/**
* Borders class
* @private
*/
var Borders = /** @class */ (function () {
function Borders() {
this.left = new Border('none', '#FFFFFF');
this.right = new Border('none', '#FFFFFF');
this.top = new Border('none', '#FFFFFF');
this.bottom = new Border('none', '#FFFFFF');
this.all = new Border('none', '#FFFFFF');
}
return Borders;
}());
export { Borders };
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {

@@ -11,35 +14,39 @@ extendStatics(d, b);

})();
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Cell = (function () {
function Cell() {
}
return Cell;
}());
exports.Cell = Cell;
var Cells = (function (_super) {
__extends(Cells, _super);
function Cells() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.add = function (cell) {
var inserted = false;
var count = 0;
for (var _i = 0, _a = _this; _i < _a.length; _i++) {
var c = _a[_i];
if (c.index === cell.index) {
_this[count] = cell;
inserted = true;
}
count++;
/**
* Worksheet class
* @private
*/
var Cell = /** @class */ (function () {
function Cell() {
}
return Cell;
}());
export { Cell };
/**
* Cells class
* @private
*/
var Cells = /** @class */ (function (_super) {
__extends(Cells, _super);
function Cells() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.add = function (cell) {
var inserted = false;
var count = 0;
for (var _i = 0, _a = _this; _i < _a.length; _i++) {
var c = _a[_i];
if (c.index === cell.index) {
_this[count] = cell;
inserted = true;
}
if (!inserted) {
_this.push(cell);
}
};
return _this;
}
return Cells;
}(Array));
exports.Cells = Cells;
});
count++;
}
if (!inserted) {
_this.push(cell);
}
};
return _this;
}
return Cells;
}(Array));
export { Cells };

@@ -1,10 +0,10 @@

define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Column = (function () {
function Column() {
}
return Column;
}());
exports.Column = Column;
});
/**
* Column class
* @private
*/
var Column = /** @class */ (function () {
function Column() {
}
return Column;
}());
export { Column };

@@ -12,7 +12,7 @@ /**

constructor(json: any);
private parseWorksheet(json);
private parseRows(rows);
private parseRow(row);
private parseCell(cell);
private parseCellValue(value);
private parseWorksheet;
private parseRows;
private parseRow;
private parseCell;
private parseCellValue;
/**

@@ -19,0 +19,0 @@ * Saves the file with specified name and sends the file to client browser

@@ -1,126 +0,145 @@

define(["require", "exports", "./value-formatter"], function (require, exports, value_formatter_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var CsvHelper = (function () {
function CsvHelper(json) {
this.csvStr = '';
this.formatter = new value_formatter_1.ValueFormatter();
this.isMicrosoftBrowser = !(!navigator.msSaveBlob);
if (json.styles !== null && json.styles !== undefined) {
this.globalStyles = new Map();
for (var i = 0; i < json.styles.length; i++) {
if (json.styles[i].name !== undefined && json.styles[i].numberFormat !== undefined) {
this.globalStyles.set(json.styles[i].name, json.styles[i].numberFormat);
}
import { ValueFormatter } from './value-formatter';
/**
* CsvHelper class
* @private
*/
var CsvHelper = /** @class */ (function () {
/* tslint:disable:no-any */
function CsvHelper(json) {
this.csvStr = '';
this.formatter = new ValueFormatter();
this.isMicrosoftBrowser = !(!navigator.msSaveBlob);
if (json.styles !== null && json.styles !== undefined) {
this.globalStyles = new Map();
for (var i = 0; i < json.styles.length; i++) {
if (json.styles[i].name !== undefined && json.styles[i].numberFormat !== undefined) {
this.globalStyles.set(json.styles[i].name, json.styles[i].numberFormat);
}
}
if (json.worksheets !== null && json.worksheets !== undefined) {
this.parseWorksheet(json.worksheets[0]);
}
// Parses Worksheets data to DOM.
if (json.worksheets !== null && json.worksheets !== undefined) {
this.parseWorksheet(json.worksheets[0]);
}
//this.csvStr = 'a1,a2,a3\nb1,b2,b3';
}
CsvHelper.prototype.parseWorksheet = function (json) {
//Rows
if (json.rows !== null && json.rows !== undefined) {
this.parseRows(json.rows);
}
};
/* tslint:disable:no-any */
CsvHelper.prototype.parseRows = function (rows) {
var count = 1;
for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
var row = rows_1[_i];
//Row index
if (row.index !== null && row.index !== undefined) {
while (count < row.index) {
this.csvStr += '\n';
count++;
}
this.parseRow(row);
}
else {
throw Error('Row index is missing.');
}
}
CsvHelper.prototype.parseWorksheet = function (json) {
if (json.rows !== null && json.rows !== undefined) {
this.parseRows(json.rows);
}
};
CsvHelper.prototype.parseRows = function (rows) {
};
/* tslint:disable:no-any */
CsvHelper.prototype.parseRow = function (row) {
if (row.cells !== null && row.cells !== undefined) {
var count = 1;
for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
var row = rows_1[_i];
if (row.index !== null && row.index !== undefined) {
while (count < row.index) {
this.csvStr += '\n';
for (var _i = 0, _a = row.cells; _i < _a.length; _i++) {
var cell = _a[_i];
//cell index
if (cell.index !== null && cell.index !== undefined) {
while (count < cell.index) {
this.csvStr += ',';
count++;
}
this.parseRow(row);
this.parseCell(cell);
}
else {
throw Error('Row index is missing.');
throw Error('Cell index is missing.');
}
}
};
CsvHelper.prototype.parseRow = function (row) {
if (row.cells !== null && row.cells !== undefined) {
var count = 1;
for (var _i = 0, _a = row.cells; _i < _a.length; _i++) {
var cell = _a[_i];
if (cell.index !== null && cell.index !== undefined) {
while (count < cell.index) {
this.csvStr += ',';
count++;
}
this.parseCell(cell);
}
else {
throw Error('Cell index is missing.');
}
}
};
/* tslint:disable:no-any */
CsvHelper.prototype.parseCell = function (cell) {
var csv = this.csvStr;
if (cell.value !== undefined) {
if (cell.value instanceof Date) {
if (cell.style !== undefined && cell.style.numberFormat !== undefined) {
/* tslint:disable-next-line:max-line-length */
csv += this.parseCellValue(this.formatter.displayText(cell.value, { type: 'dateTime', skeleton: cell.style.numberFormat }));
}
else if (cell.style !== undefined && cell.style.name !== undefined && this.globalStyles.has(cell.style.name)) {
/* tslint:disable-next-line:max-line-length */
csv += this.parseCellValue(this.formatter.displayText(cell.value, { type: 'dateTime', skeleton: this.globalStyles.get(cell.style.name) }));
}
else {
csv += cell.value;
}
}
};
CsvHelper.prototype.parseCell = function (cell) {
var csv = this.csvStr;
if (cell.value !== undefined) {
if (cell.value instanceof Date) {
if (cell.style !== undefined && cell.style.numberFormat !== undefined) {
csv += this.parseCellValue(this.formatter.displayText(cell.value, { type: 'dateTime', skeleton: cell.style.numberFormat }));
}
else if (cell.style !== undefined && cell.style.name !== undefined && this.globalStyles.has(cell.style.name)) {
csv += this.parseCellValue(this.formatter.displayText(cell.value, { type: 'dateTime', skeleton: this.globalStyles.get(cell.style.name) }));
}
else {
csv += cell.value;
}
else if (typeof (cell.value) === 'boolean') {
csv += cell.value ? 'TRUE' : 'FALSE';
}
else if (typeof (cell.value) === 'number') {
if (cell.style !== undefined && cell.style.numberFormat !== undefined) {
/* tslint:disable-next-line:max-line-length */
csv += this.parseCellValue(this.formatter.displayText(cell.value, { format: cell.style.numberFormat }));
}
else if (typeof (cell.value) === 'boolean') {
csv += cell.value ? 'TRUE' : 'FALSE';
else if (cell.style !== undefined && cell.style.name !== undefined && this.globalStyles.has(cell.style.name)) {
/* tslint:disable-next-line:max-line-length */
csv += this.parseCellValue(this.formatter.displayText(cell.value, { format: this.globalStyles.get(cell.style.name) }));
}
else if (typeof (cell.value) === 'number') {
if (cell.style !== undefined && cell.style.numberFormat !== undefined) {
csv += this.parseCellValue(this.formatter.displayText(cell.value, { format: cell.style.numberFormat }));
}
else if (cell.style !== undefined && cell.style.name !== undefined && this.globalStyles.has(cell.style.name)) {
csv += this.parseCellValue(this.formatter.displayText(cell.value, { format: this.globalStyles.get(cell.style.name) }));
}
else {
csv += cell.value;
}
}
else {
csv += this.parseCellValue(cell.value);
csv += cell.value;
}
}
this.csvStr = csv;
};
CsvHelper.prototype.parseCellValue = function (value) {
if (value.indexOf(',') !== -1) {
return value = '\"' + value + '\"';
}
else {
return value;
csv += this.parseCellValue(cell.value);
}
};
CsvHelper.prototype.save = function (fileName) {
this.buffer = new Blob(['\ufeff' + this.csvStr], { type: 'text/csv;charset=UTF-8' });
if (this.isMicrosoftBrowser) {
navigator.msSaveBlob(this.buffer, fileName);
}
else {
var dataUrl_1 = window.URL.createObjectURL(this.buffer);
var dwlLink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
dwlLink.download = fileName;
dwlLink.href = dataUrl_1;
var event_1 = document.createEvent('MouseEvent');
event_1.initEvent('click', true, true);
dwlLink.dispatchEvent(event_1);
setTimeout(function () {
window.URL.revokeObjectURL(dataUrl_1);
});
}
};
CsvHelper.prototype.saveAsBlob = function () {
return new Blob(['\ufeff' + this.csvStr], { type: 'text/csv;charset=UTF-8' });
};
return CsvHelper;
}());
exports.CsvHelper = CsvHelper;
});
}
this.csvStr = csv;
};
CsvHelper.prototype.parseCellValue = function (value) {
if (value.indexOf(',') !== -1) {
return value = '\"' + value + '\"';
}
else {
return value;
}
};
/**
* Saves the file with specified name and sends the file to client browser
* @param {string} fileName- file name to save.
* @param {Blob} buffer- the content to write in file
*/
CsvHelper.prototype.save = function (fileName) {
this.buffer = new Blob(['\ufeff' + this.csvStr], { type: 'text/csv;charset=UTF-8' });
if (this.isMicrosoftBrowser) {
navigator.msSaveBlob(this.buffer, fileName);
}
else {
var dataUrl_1 = window.URL.createObjectURL(this.buffer);
var dwlLink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
dwlLink.download = fileName;
dwlLink.href = dataUrl_1;
var event_1 = document.createEvent('MouseEvent');
event_1.initEvent('click', true, true);
dwlLink.dispatchEvent(event_1);
setTimeout(function () {
window.URL.revokeObjectURL(dataUrl_1);
});
}
};
CsvHelper.prototype.saveAsBlob = function () {
return new Blob(['\ufeff' + this.csvStr], { type: 'text/csv;charset=UTF-8' });
};
return CsvHelper;
}());
export { CsvHelper };

@@ -25,6 +25,38 @@ /**

*/
export declare type CellType = 'b' | 'e' | 'inlineStr' | 'n' | 's' | 'str';
export declare type CellType =
/**
* Cell containing a boolean.
*/
'b' |
/**
* Cell containing an error.
*/
'e' |
/**
* Cell containing an (inline) rich string.
*/
'inlineStr' |
/**
* Cell containing a number.
*/
'n' |
/**
* Cell containing a shared string.
*/
's' |
/**
* Cell containing a formula string.
*/
'str';
/**
* BlobSaveType
*/
export declare type BlobSaveType = 'text/csv' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
export declare type BlobSaveType =
/**
* MIME Type for .csv file
*/
'text/csv' |
/**
* MIME Type for .xlsx file
*/
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';

@@ -1,4 +0,1 @@

define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});

@@ -1,17 +0,13 @@

define(["require", "exports", "./cell-style", "./cell", "./column", "./row", "./workbook", "./worksheet", "./worksheets", "./csv-helper", "./value-formatter", "./blob-helper"], function (require, exports, cell_style_1, cell_1, column_1, row_1, workbook_1, worksheet_1, worksheets_1, csv_helper_1, value_formatter_1, blob_helper_1) {
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(cell_style_1);
__export(cell_1);
__export(column_1);
__export(row_1);
__export(workbook_1);
__export(worksheet_1);
__export(worksheets_1);
__export(csv_helper_1);
__export(value_formatter_1);
__export(blob_helper_1);
});
/**
* index class
*/
export * from './cell-style';
export * from './cell';
export * from './column';
export * from './row';
export * from './workbook';
export * from './worksheet';
export * from './worksheets';
export * from './csv-helper';
export * from './value-formatter';
export * from './blob-helper';
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {

@@ -11,35 +14,39 @@ extendStatics(d, b);

})();
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Row = (function () {
function Row() {
}
return Row;
}());
exports.Row = Row;
var Rows = (function (_super) {
__extends(Rows, _super);
function Rows() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.add = function (row) {
var inserted = false;
var count = 0;
for (var _i = 0, _a = _this; _i < _a.length; _i++) {
var r = _a[_i];
if (r.index === row.index) {
_this[count] = row;
inserted = true;
}
count++;
/**
* Row class
* @private
*/
var Row = /** @class */ (function () {
function Row() {
}
return Row;
}());
export { Row };
/**
* Rows class
* @private
*/
var Rows = /** @class */ (function (_super) {
__extends(Rows, _super);
function Rows() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.add = function (row) {
var inserted = false;
var count = 0;
for (var _i = 0, _a = _this; _i < _a.length; _i++) {
var r = _a[_i];
if (r.index === row.index) {
_this[count] = row;
inserted = true;
}
if (!inserted) {
_this.push(row);
}
};
return _this;
}
return Rows;
}(Array));
exports.Rows = Rows;
});
count++;
}
if (!inserted) {
_this.push(row);
}
};
return _this;
}
return Rows;
}(Array));
export { Rows };

@@ -1,29 +0,55 @@

define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base"], function (require, exports, ej2_base_1, ej2_base_2) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ValueFormatter = (function () {
function ValueFormatter(cultureName) {
this.intl = new ej2_base_2.Internationalization();
import { isNullOrUndefined } from '@syncfusion/ej2-base';
import { Internationalization } from '@syncfusion/ej2-base';
// import { IValueFormatter } from '../base/interface';
/**
* ValueFormatter class to globalize the value.
* @private
*/
var ValueFormatter = /** @class */ (function () {
function ValueFormatter(cultureName) {
this.intl = new Internationalization();
// if (!isNullOrUndefined(cultureName)) {
// this.intl.culture = cultureName;
// }
}
ValueFormatter.prototype.getFormatFunction = function (format) {
if (format.type) {
return this.intl.getDateFormat(format);
}
ValueFormatter.prototype.getFormatFunction = function (format) {
if (format.type) {
return this.intl.getDateFormat(format);
}
else {
return this.intl.getNumberFormat(format);
}
};
ValueFormatter.prototype.toView = function (value, format) {
var result = value;
if (!ej2_base_1.isNullOrUndefined(format) && !ej2_base_1.isNullOrUndefined(value)) {
result = format(value);
}
return result;
};
ValueFormatter.prototype.displayText = function (value, format) {
return this.toView(value, this.getFormatFunction(format));
};
return ValueFormatter;
}());
exports.ValueFormatter = ValueFormatter;
});
else {
return this.intl.getNumberFormat(format);
}
};
// public getParserFunction(format: NumberFormatOptions | DateFormatOptions): Function {
// if ((<DateFormatOptions>format).type) {
// return this.intl.getDateParser(<DateFormatOptions>format);
// } else {
// return this.intl.getNumberParser(<DateFormatOptions>format);
// }
// }
// public fromView(value: string, format: Function, type?: string): string | number | Date {
// if (type === 'date' || type === 'datetime' || type === 'number') {
// return format(value);
// } else {
// return value;
// }
// }
ValueFormatter.prototype.toView = function (value, format) {
var result = value;
if (!isNullOrUndefined(format) && !isNullOrUndefined(value)) {
result = format(value);
}
return result;
};
// public setCulture(cultureName: string): void {
// if (!isNullOrUndefined(cultureName)) {
// setCulture(cultureName);
// }
// }
/* tslint:disable:no-any */
ValueFormatter.prototype.displayText = function (value, format) {
return this.toView(value, this.getFormatFunction(format));
};
return ValueFormatter;
}());
export { ValueFormatter };

@@ -37,32 +37,31 @@ import { CellStyles } from './cell-style';

constructor(json: any, saveType: SaveType, culture?: string, currencyString?: string);
private parserBuiltInProperties(jsonBuiltInProperties, builtInProperties);
private parserWorksheets(json);
private mergeOptions(fromJson, toJson);
private applyProperties(sourceJson, destJson);
private getCellName(row, column);
private getColumnName(col);
private parserPrintTitle(json, sheet);
private parserFreezePanes(json, sheet);
private parserColumns(json, sheet);
private parserRows(json, sheet);
private insertMergedCellsStyle(sheet);
private createCell(value, key);
private parserRow(json, rowIndex);
private parseGrouping(json, row);
private parseCells(json, row);
private applyGlobalStyle(json, cellStyle);
private parserCellStyle(json, cellStyle, cellType);
private parserCellStyle(json, cellStyle, cellType, defStyleIndex);
private switchNumberFormat(numberFormat, type);
private getNumberFormat(numberFormat, type);
private parserBorder(json, border);
private processCellStyle(style);
private processNumFormatId(style);
private isNewFont(toCompareStyle);
private isNewBorder(toCompareStyle);
private isAllBorder(toCompareBorder);
private compareStyle(toCompareStyle);
private contains(array, item);
private getCellValueType(value);
private parseCellType(cell);
private parserBuiltInProperties;
private parserWorksheets;
private mergeOptions;
private applyProperties;
private getCellName;
private getColumnName;
private parserPrintTitle;
private parserFreezePanes;
private parserColumns;
private parserRows;
private insertMergedCellsStyle;
private createCell;
private parserRow;
private parseGrouping;
private parseCells;
private applyGlobalStyle;
private parserCellStyle;
private switchNumberFormat;
private getNumberFormat;
private parserBorder;
private processCellStyle;
private processNumFormatId;
private isNewFont;
private isNewBorder;
private isAllBorder;
private compareStyle;
private contains;
private getCellValueType;
private parseCellType;
saveAsBlob(blobSaveType: BlobSaveType): Promise<{

@@ -72,31 +71,31 @@ blobData: Blob;

save(fileName: string, proxyUrl?: string): void;
private saveInternal();
private saveWorkbook();
private saveWorksheets();
private saveWorksheet(sheet, index);
private pixelsToColumnWidth(pixels);
private trunc(x);
private pixelsToRowHeight(pixels);
private saveSheetRelations(sheet);
private saveSheetView(sheet);
private saveSharedString();
private processString(value);
private saveStyles();
private updateCellXfsStyleXfs();
private saveNumberFormats();
private saveFonts();
private saveFills();
private saveBorders();
private saveCellStyles();
private saveCellStyleXfs();
private saveCellXfs();
private saveAlignment(cellXf);
private saveApp(builtInProperties);
private saveCore(builtInProperties);
private saveTopLevelRelation();
private saveWorkbookRelation();
private saveContentType();
private addToArchive(xmlString, itemName);
private processMergeCells(cell, rowIndex, mergeCells);
private updatedMergedCellStyles(sCell, eCell, cell);
private saveInternal;
private saveWorkbook;
private saveWorksheets;
private saveWorksheet;
private pixelsToColumnWidth;
private trunc;
private pixelsToRowHeight;
private saveSheetRelations;
private saveSheetView;
private saveSharedString;
private processString;
private saveStyles;
private updateCellXfsStyleXfs;
private saveNumberFormats;
private saveFonts;
private saveFills;
private saveBorders;
private saveCellStyles;
private saveCellStyleXfs;
private saveCellXfs;
private saveAlignment;
private saveApp;
private saveCore;
private saveTopLevelRelation;
private saveWorkbookRelation;
private saveContentType;
private addToArchive;
private processMergeCells;
private updatedMergedCellStyles;
/**

@@ -108,3 +107,3 @@ * Returns the tick count corresponding to the given year, month, and day.

*/
private dateToTicks(year, month, day);
private dateToTicks;
/**

@@ -116,3 +115,3 @@ * Return the tick count corresponding to the given hour, minute, second.

*/
private timeToTicks(hour, minute, second);
private timeToTicks;
/**

@@ -126,3 +125,3 @@ * Checks if given year is a leap year.

*/
private toOADate(date);
private toOADate;
}

@@ -129,0 +128,0 @@ /**

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {

@@ -11,75 +14,95 @@ extendStatics(d, b);

})();
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Worksheet = (function () {
function Worksheet() {
this.isSummaryRowBelow = true;
this.showGridLines = true;
}
return Worksheet;
}());
exports.Worksheet = Worksheet;
var HyperLink = (function () {
function HyperLink() {
}
return HyperLink;
}());
exports.HyperLink = HyperLink;
var Grouping = (function () {
function Grouping() {
}
return Grouping;
}());
exports.Grouping = Grouping;
var FreezePane = (function () {
function FreezePane() {
}
return FreezePane;
}());
exports.FreezePane = FreezePane;
var MergeCell = (function () {
function MergeCell() {
}
return MergeCell;
}());
exports.MergeCell = MergeCell;
var MergeCells = (function (_super) {
__extends(MergeCells, _super);
function MergeCells() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.add = function (mergeCell) {
var inserted = false;
var count = 0;
for (var _i = 0, _a = _this; _i < _a.length; _i++) {
var mCell = _a[_i];
if (MergeCells.isIntersecting(mCell, mergeCell)) {
var intersectingCell = new MergeCell();
intersectingCell.x = Math.min(mCell.x, mergeCell.x);
intersectingCell.y = Math.min(mCell.Y, mergeCell.y);
intersectingCell.width = Math.max(mCell.Width + mCell.X, mergeCell.width + mergeCell.x);
intersectingCell.height = Math.max(mCell.Height + mCell.Y, mergeCell.height + mergeCell.y);
intersectingCell.ref = (_this[count].ref.split(':')[0]) + ':' + (mergeCell.ref.split(':')[1]);
_this[count] = intersectingCell;
mergeCell = intersectingCell;
inserted = true;
}
count++;
/**
* Worksheet class
* @private
*/
var Worksheet = /** @class */ (function () {
function Worksheet() {
this.isSummaryRowBelow = true;
this.showGridLines = true;
}
return Worksheet;
}());
export { Worksheet };
/**
* Hyperlink class
* @private
*/
var HyperLink = /** @class */ (function () {
function HyperLink() {
}
return HyperLink;
}());
export { HyperLink };
/**
* Grouping class
* @private
*/
var Grouping = /** @class */ (function () {
function Grouping() {
}
return Grouping;
}());
export { Grouping };
/**
* FreezePane class
* @private
*/
var FreezePane = /** @class */ (function () {
function FreezePane() {
}
return FreezePane;
}());
export { FreezePane };
/**
* MergeCell
* @private
*/
var MergeCell = /** @class */ (function () {
function MergeCell() {
}
return MergeCell;
}());
export { MergeCell };
/**
* MergeCells class
* @private
*/
var MergeCells = /** @class */ (function (_super) {
__extends(MergeCells, _super);
function MergeCells() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.add = function (mergeCell) {
var inserted = false;
var count = 0;
for (var _i = 0, _a = _this; _i < _a.length; _i++) {
var mCell = _a[_i];
if (MergeCells.isIntersecting(mCell, mergeCell)) {
var intersectingCell = new MergeCell();
intersectingCell.x = Math.min(mCell.x, mergeCell.x);
intersectingCell.y = Math.min(mCell.Y, mergeCell.y);
intersectingCell.width = Math.max(mCell.Width + mCell.X, mergeCell.width + mergeCell.x);
intersectingCell.height = Math.max(mCell.Height + mCell.Y, mergeCell.height + mergeCell.y);
intersectingCell.ref = (_this[count].ref.split(':')[0]) + ':' + (mergeCell.ref.split(':')[1]);
_this[count] = intersectingCell;
mergeCell = intersectingCell;
inserted = true;
}
if (!inserted) {
_this.push(mergeCell);
}
return mergeCell;
};
return _this;
}
MergeCells.isIntersecting = function (base, compare) {
return (base.x <= compare.x + compare.width)
&& (compare.x <= base.x + base.width)
&& (base.y <= compare.y + compare.height)
&& (compare.y <= base.y + base.height);
count++;
}
if (!inserted) {
_this.push(mergeCell);
}
return mergeCell;
};
return MergeCells;
}(Array));
exports.MergeCells = MergeCells;
});
return _this;
}
MergeCells.isIntersecting = function (base, compare) {
return (base.x <= compare.x + compare.width)
&& (compare.x <= base.x + base.width)
&& (base.y <= compare.y + compare.height)
&& (compare.y <= base.y + base.height);
};
return MergeCells;
}(Array));
export { MergeCells };
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {

@@ -11,13 +14,13 @@ extendStatics(d, b);

})();
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Worksheets = (function (_super) {
__extends(Worksheets, _super);
function Worksheets() {
return _super !== null && _super.apply(this, arguments) || this;
}
return Worksheets;
}(Array));
exports.Worksheets = Worksheets;
});
/**
* Worksheets class
* @private
*/
var Worksheets = /** @class */ (function (_super) {
__extends(Worksheets, _super);
function Worksheets() {
return _super !== null && _super.apply(this, arguments) || this;
}
return Worksheets;
}(Array));
export { Worksheets };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc