@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 33 kB
JavaScript
module.exports=function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={exports:{},id:e,loaded:!1};return n[e].call(t.exports,t,t.exports,o),t.loaded=!0,t.exports}return o.m=n,o.c=r,o.p="",o(0)}({0:function(e,t,n){e.exports=n(1655)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},20:function(e,t){e.exports=require("../kendo.core")},913:function(e,t){e.exports=require("./utils")},1655:function(e,t,n){var r;n(3),n=[n(20),n(913)],void 0===(t="function"==typeof(r=function(){var o=window.kendo.jQuery,e=(window.kendo.ooxml=window.kendo.ooxml||{},kendo.ooxml),A=o.map,R=e.createZip,n={toString:function(e){return e}},u=kendo.Class.extend({});function r(e,t,n){return(1461*(e+4800+((t-13)/12|0))/4|0)+(367*(t-1-12*((t-13)/12|0))/12|0)-(3*((e+4900+((t-13)/12|0))/100|0)/4|0)+n-32075}u.register=function(e){n=e},u.toString=function(e,t){return n.toString(e,t)};var i=r(1900,0,-1);function a(e,t,n){return r(e,t,n)-i}function s(e,t,n,r){return(e+(t+(n+r/1e3)/60)/60)/24}function p(e){var t=s(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());var n=a(e.getFullYear(),e.getMonth(),e.getDate());return n<0?n-1+t:n+t}var t="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",l="data:"+t+";base64,",m={compression:"DEFLATE",type:"base64"},f={compression:"DEFLATE",type:"blob"},c={compression:"DEFLATE",type:"arraybuffer"};function d(e){return l+e}function O(e,t){return t.indexOf(e)}var N=JSON.parse.bind(JSON);function y(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""").replace(/\'/g,"'")}function h(e,t){var n="";for(var r=0;r<e;++r)n+=t(r);return n}function w(n,r){var o="";if(n!=null)if(Array.isArray(n))for(var e=0;e<n.length;++e)o+=r(n[e],e);else if(typeof n=="object")Object.keys(n).forEach(function(e,t){o+=r(n[e],e,t)});return o}var b='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r',q=b+'\n <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>\n <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>\n <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>\n </Relationships>',z=function(e){var t=e.creator;var n=e.lastModifiedBy;var r=e.created;var o=e.modified;return b+'\n <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"\n xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"\n xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n <dc:creator>'+y(t)+"</dc:creator>\n <cp:lastModifiedBy>"+y(n)+'</cp:lastModifiedBy>\n <dcterms:created xsi:type="dcterms:W3CDTF">'+y(r)+'</dcterms:created>\n <dcterms:modified xsi:type="dcterms:W3CDTF">'+y(o)+"</dcterms:modified>\n</cp:coreProperties>"},B=function(e){var t=e.sheets;return b+'\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">\n <Application>Microsoft Excel</Application>\n <DocSecurity>0</DocSecurity>\n <ScaleCrop>false</ScaleCrop>\n <HeadingPairs>\n <vt:vector size="2" baseType="variant">\n <vt:variant>\n <vt:lpstr>Worksheets</vt:lpstr>\n </vt:variant>\n <vt:variant>\n <vt:i4>'+t.length+'</vt:i4>\n </vt:variant>\n </vt:vector>\n </HeadingPairs>\n <TitlesOfParts>\n <vt:vector size="'+t.length+'" baseType="lpstr">'+w(t,function(e,t){return e.options.title?"<vt:lpstr>"+y(e.options.title)+"</vt:lpstr>":"<vt:lpstr>Sheet"+(t+1)+"</vt:lpstr>"})+"</vt:vector>\n </TitlesOfParts>\n <LinksUpToDate>false</LinksUpToDate>\n <SharedDoc>false</SharedDoc>\n <HyperlinksChanged>false</HyperlinksChanged>\n <AppVersion>14.0300</AppVersion>\n</Properties>"},V=function(e){var t=e.sheetCount;var n=e.commentFiles;var r=e.drawingFiles;return b+'\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">\n <Default Extension="png" ContentType="image/png"/>\n <Default Extension="gif" ContentType="image/gif"/>\n <Default Extension="jpg" ContentType="image/jpeg"/>\n <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />\n <Default Extension="xml" ContentType="application/xml" />\n <Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing"/>\n <Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" />\n <Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>\n <Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>\n '+h(t,function(e){return'<Override PartName="/xl/worksheets/sheet'+(e+1)+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />'})+"\n "+w(n,function(e){return'<Override PartName="/xl/'+e+'" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"/>'})+"\n "+w(r,function(e){return'<Override PartName="/xl/drawings/'+e+'" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml"/>'})+'\n <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />\n <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" />\n</Types>'},j=function(e){var t=e.sheets;var n=e.filterNames;var r=e.userNames;return b+'\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">\n <fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303" />\n <workbookPr defaultThemeVersion="124226" />\n <bookViews>\n <workbookView xWindow="240" yWindow="45" windowWidth="18195" windowHeight="7995" />\n </bookViews>\n <sheets>\n '+w(t,function(e,t){var n=e.options;var r=n.name||n.title||"Sheet"+(t+1);return'<sheet name="'+y(r)+'" sheetId="'+(t+1)+'" r:id="rId'+(t+1)+'" />'})+"\n </sheets>\n "+(n.length||r.length?"\n <definedNames>\n "+w(n,function(e){return'\n <definedName name="_xlnm._FilterDatabase" hidden="1" localSheetId="'+e.localSheetId+'">'+y(we(e.name))+"!"+y(e.from)+":"+y(e.to)+"</definedName>"})+"\n "+w(r,function(e){return'\n <definedName name="'+e.name+'" hidden="'+(e.hidden?1:0)+'" '+(e.localSheetId!=null?'localSheetId="'+e.localSheetId+'"':"")+">"+y(e.value)+"</definedName>"})+"\n </definedNames>":"")+'\n <calcPr fullCalcOnLoad="1" calcId="145621" />\n</workbook>'},v=function(e){var t=e.frozenColumns;var n=e.frozenRows;var r=e.columns;var o=e.defaults;var f=e.data;var c=e.index;var i=e.mergeCells;var a=e.autoFilter;var s=e.filter;var d=e.showGridLines;var l=e.hyperlinks;var u=e.validations;var m=e.defaultCellStyleId;var p=e.rtl;var h=e.legacyDrawing;var v=e.drawing;var g=e.lastRow;var x=e.lastCol;return b+'\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac">\n '+(g&&x?'<dimension ref="A1:'+k(g-1,x-1)+'" />':"")+"\n\n <sheetViews>\n <sheetView "+(p?'rightToLeft="1"':"")+" "+(c===0?'tabSelected="1"':"")+' workbookViewId="0" '+(d===false?'showGridLines="0"':"")+">\n "+(n||t?'\n <pane state="frozen"\n '+(t?'xSplit="'+t+'"':"")+"\n "+(n?'ySplit="'+n+'"':"")+'\n topLeftCell="'+(String.fromCharCode(65+(t||0))+((n||0)+1))+'"\n />':"")+'\n </sheetView>\n </sheetViews>\n\n <sheetFormatPr x14ac:dyDescent="0.25" '+(!o.skipCustomHeight?'customHeight="1"':"")+' defaultRowHeight="'+(o.rowHeight?o.rowHeight*.75:15)+'"\n '+(o.columnWidth?'defaultColWidth="'+F(o.columnWidth)+'"':"")+" />\n\n "+(m!=null||r&&r.length>0?"\n <cols>\n "+(!r||!r.length?'\n <col min="1" max="16384" style="'+m+'"\n '+(o.columnWidth?'width="'+F(o.columnWidth)+'"':"")+" /> ":"")+"\n "+w(r,function(e,t){var n=typeof e.index==="number"?e.index+1:t+1;if(e.width===0)return"<col "+(m!=null?'style="'+m+'"':"")+'\n min="'+n+'" max="'+n+'" hidden="1" customWidth="1" />';return"<col "+(m!=null?'style="'+m+'"':"")+'\n min="'+n+'" max="'+n+'" customWidth="1"\n '+(e.autoWidth?'width="'+(e.width*7+5)/7*256/256+'" bestFit="1"':'width="'+F(e.width)+'"')+" />"})+"\n </cols>":"")+"\n\n <sheetData>\n "+w(f,function(e,t){var n=typeof e.index==="number"?e.index+1:t+1;return'\n <row r="'+n+'" x14ac:dyDescent="0.25"\n '+(e.level?'outlineLevel="'+e.level+'"':"")+"\n "+(e.height===0?'hidden="1"':e.height?'ht="'+P(e.height)+'" customHeight="1"':"")+">\n "+w(e.data,function(e){return'\n <c r="'+e.ref+'" '+(e.style?'s="'+e.style+'"':"")+" "+(e.type?'t="'+e.type+'"':"")+">\n "+(e.formula!=null?S(e.formula):"")+"\n "+(e.value!=null?"<v>"+y(e.value)+"</v>":"")+"\n </c>"})+"\n </row>\n "})+"\n </sheetData>\n\n "+(a?'<autoFilter ref="'+a.from+":"+a.to+'"/>':s?I(s):"")+"\n\n "+(i.length?'\n <mergeCells count="'+i.length+'">\n '+w(i,function(e){return'<mergeCell ref="'+e+'"/>'})+"\n </mergeCells>":"")+"\n\n "+(u.length?"\n <dataValidations>\n "+w(u,function(e){return'\n <dataValidation sqref="'+e.sqref.join(" ")+'"\n showErrorMessage="'+e.showErrorMessage+'"\n type="'+y(e.type)+'"\n '+(e.type!=="list"?'operator="'+y(e.operator)+'"':"")+'\n allowBlank="'+e.allowBlank+'"\n showDropDown="'+e.showDropDown+'"\n '+(e.error?'error="'+y(e.error)+'"':"")+"\n "+(e.errorTitle?'errorTitle="'+y(e.errorTitle)+'"':"")+">\n "+(e.formula1?"<formula1>"+y(e.formula1)+"</formula1>":"")+"\n "+(e.formula2?"<formula2>"+y(e.formula2)+"</formula2>":"")+"\n </dataValidation>"})+"\n </dataValidations>":"")+"\n\n "+(l.length?"\n <hyperlinks>\n "+w(l,function(e){return'\n <hyperlink ref="'+e.ref+'" r:id="'+e.rId+'"/>'})+"\n </hyperlinks>":"")+'\n\n <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" />\n '+(v?'<drawing r:id="'+v+'"/>':"")+"\n "+(h?'<legacyDrawing r:id="'+h+'"/>':"")+"\n</worksheet>"},W=function(e){var t=e.count;return b+'\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n '+h(t,function(e){return'\n <Relationship Id="rId'+(e+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(e+1)+'.xml" />'})+'\n <Relationship Id="rId'+(t+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />\n <Relationship Id="rId'+(t+2)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" />\n</Relationships>'},g=function(e){var t=e.hyperlinks;var n=e.comments;var r=e.sheetIndex;var o=e.drawings;return b+'\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n '+w(t,function(e){return'\n <Relationship Id="'+e.rId+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="'+y(e.target)+'" TargetMode="External" />'})+"\n "+(!n.length?"":'\n <Relationship Id="comment'+r+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Target="../comments'+r+'.xml"/>\n <Relationship Id="vml'+r+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing'+r+'.vml"/>')+"\n "+(!o.length?"":'\n <Relationship Id="drw'+r+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" Target="../drawings/drawing'+r+'.xml"/>')+"\n</Relationships>"},x=function(e){var t=e.comments;return b+'\n<comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">\n <authors>\n <author></author>\n </authors>\n <commentList>\n '+w(t,function(e){return'\n <comment ref="'+e.ref+'" authorId="0">\n <text>\n <r>\n <rPr>\n <sz val="8"/>\n <color indexed="81"/>\n <rFont val="Tahoma"/>\n <charset val="1"/>\n </rPr>\n <t>'+y(e.text)+"</t>\n </r>\n </text>\n </comment>"})+"\n </commentList>\n</comments>"},T=function(e){var t=e.comments;return'<xml xmlns:v="urn:schemas-microsoft-com:vml"\n xmlns:o="urn:schemas-microsoft-com:office:office"\n xmlns:x="urn:schemas-microsoft-com:office:excel">\n <v:shapetype coordsize="21600,21600" id="_x0000_t202" path="m,l,21600r21600,l21600,xe">\n <v:stroke joinstyle="miter"/>\n <v:path gradientshapeok="t" o:connecttype="rect"/>\n </v:shapetype>\n '+w(t,function(e){return'\n <v:shape type="#_x0000_t202" style="visibility: hidden" fillcolor="#ffffe1" o:insetmode="auto">\n <v:shadow on="t" color="black" obscured="t"/>\n <x:ClientData ObjectType="Note">\n <x:MoveWithCells/>\n <x:SizeWithCells/>\n <x:Anchor>'+e.anchor+"</x:Anchor>\n <x:AutoFill>False</x:AutoFill>\n <x:Row>"+e.row+"</x:Row>\n <x:Column>"+e.col+"</x:Column>\n </x:ClientData>\n </v:shape>"})+"\n</xml>"},_=function(e){return b+'\n<xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"\n xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"\n xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">\n '+w(e,function(e,t){return'\n <xdr:oneCellAnchor editAs="oneCell">\n <xdr:from>\n <xdr:col>'+e.col+"</xdr:col>\n <xdr:colOff>"+e.colOffset+"</xdr:colOff>\n <xdr:row>"+e.row+"</xdr:row>\n <xdr:rowOff>"+e.rowOffset+'</xdr:rowOff>\n </xdr:from>\n <xdr:ext cx="'+e.width+'" cy="'+e.height+'" />\n <xdr:pic>\n <xdr:nvPicPr>\n <xdr:cNvPr id="'+(t+1)+'" name="Picture '+(t+1)+'"/>\n <xdr:cNvPicPr/>\n </xdr:nvPicPr>\n <xdr:blipFill>\n <a:blip r:embed="'+e.imageId+'"/>\n <a:stretch>\n <a:fillRect/>\n </a:stretch>\n </xdr:blipFill>\n <xdr:spPr>\n <a:prstGeom prst="rect">\n <a:avLst/>\n </a:prstGeom>\n </xdr:spPr>\n </xdr:pic>\n <xdr:clientData/>\n </xdr:oneCellAnchor>'})+"\n</xdr:wsDr>"},C=function(e){return b+'\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n '+w(e,function(e){return'\n <Relationship Id="'+e.rId+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="'+e.target+'"/>'})+"\n</Relationships>"},X=function(e){var t=e.count;var n=e.uniqueCount;var r=e.indexes;return b+'\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="'+t+'" uniqueCount="'+n+'">\n '+w(Object.keys(r),function(e){return'\n <si><t xml:space="preserve">'+y(e.substring(1))+"</t></si>"})+"\n</sst>"},H=function(e){var t=e.formats;var n=e.fonts;var r=e.fills;var o=e.borders;var i=e.styles;return b+'\n<styleSheet\n xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"\n xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"\n mc:Ignorable="x14ac"\n xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">\n <numFmts count="'+t.length+'">\n '+w(t,function(e,t){return'\n <numFmt formatCode="'+y(e.format)+'" numFmtId="'+(165+t)+'" />'})+'\n </numFmts>\n <fonts count="'+(n.length+1)+'" x14ac:knownFonts="1">\n <font>\n <sz val="11" />\n <color theme="1" />\n <name val="Calibri" />\n <family val="2" />\n <scheme val="minor" />\n </font>\n '+w(n,function(e){return"\n <font>\n "+(e.bold?"<b/>":"")+"\n "+(e.italic?"<i/>":"")+"\n "+(e.underline?"<u/>":"")+'\n <sz val="'+(e.fontSize||11)+'" />\n '+(e.color?'<color rgb="'+y(e.color)+'" />':'<color theme="1" />')+"\n "+(e.fontFamily?'\n <name val="'+y(e.fontFamily)+'" />\n <family val="2" />\n ':'\n <name val="Calibri" />\n <family val="2" />\n <scheme val="minor" />\n ')+"\n </font>"})+'\n </fonts>\n <fills count="'+(r.length+2)+'">\n <fill><patternFill patternType="none"/></fill>\n <fill><patternFill patternType="gray125"/></fill>\n '+w(r,function(e){return"\n "+(e.background?'\n <fill>\n <patternFill patternType="solid">\n <fgColor rgb="'+y(e.background)+'"/>\n </patternFill>\n </fill>\n ':"")})+'\n </fills>\n <borders count="'+(o.length+1)+'">\n <border><left/><right/><top/><bottom/><diagonal/></border>\n '+w(o,ne)+'\n </borders>\n <cellStyleXfs count="1">\n <xf borderId="0" fillId="0" fontId="0" />\n </cellStyleXfs>\n <cellXfs count="'+(i.length+1)+'">\n <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />\n '+w(i,function(e){return'\n <xf xfId="0"\n '+(e.fontId?'fontId="'+e.fontId+'" applyFont="1"':"")+"\n "+(e.fillId?'fillId="'+e.fillId+'" applyFill="1"':"")+"\n "+(e.numFmtId?'numFmtId="'+e.numFmtId+'" applyNumberFormat="1"':"")+"\n "+(e.textAlign||e.verticalAlign||e.wrap?'applyAlignment="1"':"")+"\n "+(e.borderId?'borderId="'+e.borderId+'" applyBorder="1"':"")+">\n "+(e.textAlign||e.verticalAlign||e.wrap?"\n <alignment\n "+(e.textAlign?'horizontal="'+y(e.textAlign)+'"':"")+"\n "+(e.verticalAlign?'vertical="'+y(e.verticalAlign)+'"':"")+"\n "+(e.indent?'indent="'+y(e.indent)+'"':"")+"\n "+(e.wrap?'wrapText="1"':"")+" />\n ":"")+"\n </xf>\n "})+'\n </cellXfs>\n <cellStyles count="1">\n <cellStyle name="Normal" xfId="0" builtinId="0"/>\n </cellStyles>\n <dxfs count="0" />\n <tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleMedium9" />\n</styleSheet>'};function S(e){if(typeof e=="string")return"<f>"+y(e)+"</f>";return'<f t="array" ref="'+e.ref+'">'+y(e.src)+"</f>"}function D(e){var t=Math.floor(e/26)-1;return(t>=0?D(t):"")+String.fromCharCode(65+e%26)}function k(e,t){return D(t)+(e+1)}function L(e,t){return"$"+D(t)+"$"+(e+1)}function U(e){var t=e.frozenRows||(e.freezePane||{}).rowSplit||1;return t-1}function F(e){var t=7;return e/t-Math.floor(128/t)/256}function P(e){return e*.75}function M(e){return String(e).replace(/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,"").replace(/\r?\n/g,"\r\n")}var $=kendo.Class.extend({init:function(e,t,n,r){this.options=e;this._strings=t;this._styles=n;this._borders=r;this._validations={};this._comments=[];this._drawings=e.drawings||[];this._hyperlinks=(this.options.hyperlinks||[]).map(function(e,t){return o.extend({},e,{rId:"link"+t})})},relsToXML:function(){var e=this._hyperlinks;var t=this._comments;var n=this._drawings;if(e.length||t.length||n.length)return g({hyperlinks:e,comments:t,sheetIndex:this.options.sheetIndex,drawings:n})},toXML:function(f){var e=this;var t=this.options.mergedCells||[];var c=this.options.rows||[];var n=oe(c,t);this._readCells(n);var r=this.options.filter;var o;if(r&&typeof r.from==="number"&&typeof r.to==="number")r={from:k(U(this.options),r.from),to:k(U(this.options),r.to)};else if(r&&r.ref&&r.columns){o=r;r=null}var i=[];for(var a in this._validations)if(Object.prototype.hasOwnProperty.call(e._validations,a))i.push(e._validations[a]);var s=null;if(this.options.defaultCellStyle)s=this._lookupStyle(this.options.defaultCellStyle);var l=this.options.freezePane||{};var m=this.options.defaults||{};var d=this.options.rows?this._getLastRow():1;var u=this.options.rows?this._getLastCol():1;return v({frozenColumns:this.options.frozenColumns||l.colSplit,frozenRows:this.options.frozenRows||l.rowSplit,columns:this.options.columns,defaults:m,data:n,index:f,mergeCells:t,autoFilter:r,filter:o,showGridLines:this.options.showGridLines,hyperlinks:this._hyperlinks,validations:i,defaultCellStyleId:s,rtl:this.options.rtl!==undefined?this.options.rtl:m.rtl,legacyDrawing:this._comments.length?"vml"+this.options.sheetIndex:null,drawing:this._drawings.length?"drw"+this.options.sheetIndex:null,lastRow:d,lastCol:u})},commentsXML:function(){if(this._comments.length)return x({comments:this._comments})},drawingsXML:function(r){if(this._drawings.length){var o={};var e=this._drawings.map(function(e){var t=E(e.topLeftCell);var n=o[e.image];if(!n)n=o[e.image]={rId:"img"+e.image,target:r[e.image].target};return{col:t.col,colOffset:me(e.offsetX),row:t.row,rowOffset:me(e.offsetY),width:me(e.width),height:me(e.height),imageId:n.rId}});return{main:_(e),rels:C(o)}}},legacyDrawing:function(){if(this._comments.length)return T({comments:this._comments})},_lookupString:function(e){var t="$"+e;var n=this._strings.indexes[t];var r;if(n!==undefined)r=n;else{r=this._strings.indexes[t]=this._strings.uniqueCount;this._strings.uniqueCount++}this._strings.count++;return r},_lookupStyle:function(e){var t=JSON.stringify(e);if(t==="{}")return 0;var n=O(t,this._styles);if(n<0)n=this._styles.push(t)-1;return n+1},_lookupBorder:function(e){var t=JSON.stringify(e);if(t==="{}")return;var n=O(t,this._borders);if(n<0)n=this._borders.push(t)-1;return n+1},_readCells:function(e){var t=this;for(var n=0;n<e.length;n++){var r=e[n];var o=r.cells;r.data=[];for(var i=0;i<o.length;i++){var a=t._cell(o[i],r.index,i);if(a)r.data.push(a)}}},_cell:function(r,e,t){if(!r||r===re)return null;var n=r.value;var o={};if(r.borderLeft)o.left=r.borderLeft;if(r.borderRight)o.right=r.borderRight;if(r.borderTop)o.top=r.borderTop;if(r.borderBottom)o.bottom=r.borderBottom;o=this._lookupBorder(o);var f=this.options.defaultCellStyle||{};var i={borderId:o};(function(e){e("color");e("background");e("bold");e("italic");e("underline");if(!e("fontFamily"))e("fontName","fontFamily");e("fontSize");e("format");if(!e("textAlign"))e("hAlign","textAlign");if(!e("verticalAlign"))e("vAlign","verticalAlign");e("wrap");e("indent")})(function(e,t){var n=r[e];if(n===undefined)n=f[e];if(n!==undefined){i[t||e]=n;return true}});var c=this.options.columns||[];var a=c[t];var s=typeof n;if(a&&a.autoWidth&&(!r.colSpan||r.colSpan===1)){var l=n;if(s==="number")l=u.toString(n,r.format);a.width=Math.max(a.width||0,String(l).length)}if(s==="string"){n=M(n);n=this._lookupString(n);s="s"}else if(s==="number")s="n";else if(s==="boolean"){s="b";n=Number(n)}else if(n&&n.getTime){s=null;n=p(n);if(!i.format)i.format="mm-dd-yy"}else{s=null;n=null}i=this._lookupStyle(i);var m=k(e,t);if(r.validation)this._addValidation(r.validation,m);if(r.comment){var d=[t+1,15,e,10,t+3,15,e+3,4];this._comments.push({ref:m,text:r.comment,row:e,col:t,anchor:d.join(", ")})}return{value:n,formula:r.formula,type:s,style:i,ref:m}},_addValidation:function(e,t){var n={showErrorMessage:e.type==="reject"?1:0,formula1:e.from,formula2:e.to,type:Q[e.dataType]||e.dataType,operator:J[e.comparerType]||e.comparerType,allowBlank:e.allowNulls?1:0,showDropDown:e.showButton?0:1,error:e.messageTemplate,errorTitle:e.titleTemplate};var r=JSON.stringify(n);if(!this._validations[r]){this._validations[r]=n;n.sqref=[]}this._validations[r].sqref.push(t)},_getLastRow:function(){return G(this.options.rows)},_getLastCol:function(){var t=0;this.options.rows.forEach(function(e){if(e.cells)t=Math.max(t,G(e.cells))});return t}});function G(e){var t=e.length;e.forEach(function(e){if(e.index&&e.index>=t)t=e.index+1});return t}var J={greaterThanOrEqualTo:"greaterThanOrEqual",lessThanOrEqualTo:"lessThanOrEqual"},Q={number:"decimal"},Z={General:0,0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"[$-404]e/m/d":27,"m/d/yy":30,t0:59,"t0.00":60,"t#,##0":61,"t#,##0.00":62,"t0%":67,"t0.00%":68,"t# ?/?":69,"t# ??/??":70};function K(e){var t=e;if(t.length<6)t=t.replace(/(\w)/g,function(e,t){return t+t});t=t.substring(1).toUpperCase();if(t.length<8)t="FF"+t;return t}var Y=kendo.Class.extend({init:function(e){var n=this;this.options=e||{};this._strings={indexes:{},count:0,uniqueCount:0};this._styles=[];this._borders=[];this._images=this.options.images;this._imgId=0;this._sheets=A(this.options.sheets||[],function(e,t){e.defaults=n.options;e.sheetIndex=t+1;return new $(e,n._strings,n._styles,n._borders)})},imageFilename:function(e){var t=++this._imgId;switch(e){case"image/jpg":case"image/jpeg":return"image"+t+".jpg";case"image/png":return"image"+t+".png";case"image/gif":return"image"+t+".gif";default:return"image"+t+".bin"}},toZIP:function(){var r=this;var e=R();var f=e.folder("docProps");f.file("core.xml",z({creator:this.options.creator||"Kendo UI",lastModifiedBy:this.options.creator||"Kendo UI",created:this.options.date||(new Date).toJSON(),modified:this.options.date||(new Date).toJSON()}));var t=this._sheets.length;f.file("app.xml",B({sheets:this._sheets}));var c=e.folder("_rels");c.file(".rels",q);var n=e.folder("xl");var d=n.folder("_rels");d.file("workbook.xml.rels",W({count:t}));if(this._images){var u=n.folder("media");Object.keys(this._images).forEach(function(e){var t=r._images[e];var n=r.imageFilename(t.type);u.file(n,t.data);t.target="../media/"+n})}var p={};n.file("workbook.xml",j({sheets:this._sheets,filterNames:A(this._sheets,function(e,t){var n=e.options;var r=n.name||n.title||"Sheet"+(t+1);p[r.toLowerCase()]=t;var o=n.filter;if(o)if(o.ref){var i=o.ref.split(":");var a=E(i[0]);var s=E(i[1]);return{localSheetId:t,name:r,from:L(a.row,a.col),to:L(s.row,s.col)}}else if(typeof o.from!=="undefined"&&typeof o.to!=="undefined")return{localSheetId:t,name:r,from:L(U(n),o.from),to:L(U(n),o.to)}}),userNames:A(this.options.names||[],function(e){return{name:e.localName,localSheetId:e.sheet?p[e.sheet.toLowerCase()]:null,value:e.value,hidden:e.hidden}})}));var h=n.folder("worksheets");var o=n.folder("drawings");var v=o.folder("_rels");var g=h.folder("_rels");var x=[];var y=[];for(var i=0;i<t;i++){var a=r._sheets[i];var w="sheet"+(i+1)+".xml";var b=a.toXML(i);var k=a.relsToXML();var I=a.commentsXML();var T=a.legacyDrawing();var s=a.drawingsXML(r._images);if(k)g.file(w+".rels",k);if(I){var _="comments"+a.options.sheetIndex+".xml";n.file(_,I);x.push(_)}if(T)o.file("vmlDrawing"+a.options.sheetIndex+".vml",T);if(s){var l="drawing"+a.options.sheetIndex+".xml";o.file(l,s.main);v.file(l+".rels",s.rels);y.push(l)}h.file(w,b)}var C=A(this._borders,N);var m=A(this._styles,N);var S=function(e){return e.underline||e.bold||e.italic||e.color||e.fontFamily||e.fontSize};var D=function(e){var t=Number(e);var n;if(t)n=t*3/4;return n};var F=A(m,function(e){if(e.fontSize)e.fontSize=D(e.fontSize);if(e.color)e.color=K(e.color);if(S(e))return e});var P=A(m,function(e){if(e.format&&Z[e.format]===undefined)return e});var M=A(m,function(e){if(e.background){e.background=K(e.background);return e}});n.file("styles.xml",H({fonts:F,fills:M,formats:P,borders:C,styles:A(m,function(e){var t={};if(S(e))t.fontId=O(e,F)+1;if(e.background)t.fillId=O(e,M)+2;t.textAlign=e.textAlign;t.indent=e.indent;t.verticalAlign=e.verticalAlign;t.wrap=e.wrap;t.borderId=e.borderId;if(e.format)if(Z[e.format]!==undefined)t.numFmtId=Z[e.format];else t.numFmtId=165+O(e,P);return t})}));n.file("sharedStrings.xml",X(this._strings));e.file("[Content_Types].xml",V({sheetCount:t,commentFiles:x,drawingFiles:y}));return e},toDataURL:function(){var e=this.toZIP();return e.generateAsync?e.generateAsync(m).then(d):d(e.generate(m))},toBlob:function(){var e=this.toZIP();if(e.generateAsync)return e.generateAsync(f);return new Blob([e.generate(c)],{type:t})}});function ee(e){var t="thin";if(e===2)t="medium";else if(e===3)t="thick";return t}function te(e,t){var n="";if(t){n+="<"+e+' style="'+ee(t.size)+'">';if(t.color)n+='<color rgb="'+K(t.color)+'"/>';n+="</"+e+">"}return n}function ne(e){return"<border>"+te("left",e.left)+te("right",e.right)+te("top",e.top)+te("bottom",e.bottom)+"</border>"}var re={};function oe(e,t){var r=[];var o=[];ie(e,function(e,t){var n={_source:e,index:t,height:e.height,level:e.level,cells:[]};r.push(n);o[t]=n});var n=ae(r).slice(0);var i={rowData:r,rowsByIndex:o,mergedCells:t};for(var a=0;a<n.length;a++){fe(n[a],i);delete n[a]._source}return ae(r)}function ie(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(!r)continue;var o=r.index;if(typeof o!=="number")o=n;t(r,o)}}function ae(e){return e.sort(function(e,t){return e.index-t.index})}function se(e,t){if(e.indexOf(t)<0)e.push(t)}function le(e,t){for(var n=0;n<e.length;++n){var r=e[n];var o=r.split(":");var i=o[0];if(i===t){var a=o[1];i=E(i);a=E(a);return{rowSpan:a.row-i.row+1,colSpan:a.col-i.col+1}}}}function E(e){function t(e){var t=e.toUpperCase();var n=0;for(var r=0;r<t.length;++r)n=n*26+t.charCodeAt(r)-64;return n-1}function n(e){return parseInt(e,10)-1}var r=/^([a-z]+)(\d+)$/i.exec(e);return{row:n(r[2]),col:t(r[1])}}function me(e){return Math.round(e*9525)}function fe(e,t){var f=e._source;var n=e.index;var r=f.cells;var c=e.cells;if(!r)return;for(var d=0;d<r.length;d++){var o=r[d]||re;var i=o.rowSpan||1;var a=o.colSpan||1;var s=ce(c,o);var u=k(n,s);if(i===1&&a===1){var p=le(t.mergedCells,u);if(p){a=p.colSpan;i=p.rowSpan}}pe(o,c,s,a);if(i>1||a>1)se(t.mergedCells,u+":"+k(n+i-1,s+a-1));if(i>1)for(var l=n+1;l<n+i;l++){var m=t.rowsByIndex[l];if(!m){m=t.rowsByIndex[l]={index:l,cells:[]};t.rowData.push(m)}pe(o,m.cells,s-1,a+1)}}}function ce(e,t){var n;if(typeof t.index==="number"){n=t.index;de(e,t,t.index)}else n=ue(e,t);return n}function de(e,t,n){e[n]=t}function ue(e,t){var n=e.length;for(var r=0;r<e.length+1;r++)if(!e[r]){e[r]=t;n=r;break}return n}function pe(e,t,n,r){for(var o=1;o<r;o++){var i={borderTop:e.borderTop,borderRight:e.borderRight,borderBottom:e.borderBottom,borderLeft:e.borderLeft};de(t,i,n+o)}}var he=function(e){var t=e.ref;var n=e.columns;var r=e.generators;return'\n<autoFilter ref="'+t+'">\n '+w(n,function(e){return'\n <filterColumn colId="'+e.index+'">\n '+r[e.filter](e)+"\n </filterColumn>\n "})+"\n</autoFilter>"},ve=function(e){var t=e.logic;var n=e.criteria;return"\n<customFilters "+(t==="and"?'and="1"':"")+">\n"+w(n,function(e){var t=I.customOperator(e);var n=I.customValue(e);return"<customFilter "+(t?'operator="'+t+'"':"")+' val="'+n+'"/>'})+"\n</customFilters>"},ge=function(e){var t=e.type;return'<dynamicFilter type="'+I.dynamicFilterType(t)+'" />'},xe=function(e){var t=e.type;var n=e.value;return'<top10 percent="'+(/percent$/i.test(t)?1:0)+'"\n top="'+(/^top/i.test(t)?1:0)+'"\n val="'+n+'" />'},ye=function(e){var t=e.blanks;var n=e.values;return"<filters "+(t?'blank="1"':"")+">\n "+w(n,function(e){return'\n <filter val="'+e+'" />'})+"\n </filters>"};function I(e){return he({ref:e.ref,columns:e.columns,generators:{custom:ve,dynamic:ge,top:xe,value:ye}})}function we(e){if(/^\'/.test(e))return e;if(/^[a-z_][a-z0-9_]*$/i.test(e))return e;return"'"+e.replace(/\x27/g,"\\'")+"'"}I.customOperator=function(e){return{eq:"equal",gt:"greaterThan",gte:"greaterThanOrEqual",lt:"lessThan",lte:"lessThanOrEqual",ne:"notEqual",doesnotstartwith:"notEqual",doesnotendwith:"notEqual",doesnotcontain:"notEqual",doesnotmatch:"notEqual"}[e.operator.toLowerCase()]},I.customValue=function(e){function t(e){return e.replace(/([*?])/g,"~$1")}switch(e.operator.toLowerCase()){case"startswith":case"doesnotstartwith":return t(e.value)+"*";case"endswith":case"doesnotendwith":return"*"+t(e.value);case"contains":case"doesnotcontain":return"*"+t(e.value)+"*";default:return e.value}},I.dynamicFilterType=function(e){return{quarter1:"Q1",quarter2:"Q2",quarter3:"Q3",quarter4:"Q4",january:"M1",february:"M2",march:"M3",april:"M4",may:"M5",june:"M6",july:"M7",august:"M8",september:"M9",october:"M10",november:"M11",december:"M12"}[e.toLowerCase()]||e},kendo.deepExtend(kendo.ooxml,{IntlService:u,Workbook:Y,Worksheet:$})})?r.apply(t,n):r)||(e.exports=t)}});