/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("util/undoredostack.min",["kendo.core.min"],e)}(function(){!function(e){var t=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this,t),this.clear()},events:["undo","redo"],push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1},undo:function(){if(this.canUndo()){var e=this.stack[this.currentCommandIndex--];e.undo(),this.trigger("undo",{command:e})}},redo:function(){if(this.canRedo()){var e=this.stack[++this.currentCommandIndex];e.redo(),this.trigger("redo",{command:e})}},clear:function(){this.stack=[],this.currentCommandIndex=-1},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}});e.deepExtend(e,{util:{UndoRedoStack:t}})}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==H}function t(e,t){var i=n(t);return B.round(e*i)/i}function n(e){return e?B.pow(10,e):1}function i(e,t,n){return B.max(B.min(e,n),t)}function r(e){return e*I}function o(e){return e/I}function s(e){return"number"==typeof e&&!isNaN(e)}function a(t,n){return e(t)?t:n}function l(e){return e*e}function u(e){var t,n=[];for(t in e)n.push(t+e[t]);return n.sort().join("")}function c(e){var t,n=2166136261;for(t=0;t<e.length;++t)n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24),n^=e.charCodeAt(t);return n>>>0}function h(e){return c(u(e))}function d(e){var t,n=e.length,i=z,r=P;for(t=0;t<n;t++)r=B.max(r,e[t]),i=B.min(i,e[t]);return{min:i,max:r}}function f(e){return d(e).min}function p(e){return d(e).max}function m(e){return v(e).min}function g(e){return v(e).max}function v(e){var t,n,i,r=z,o=P;for(t=0,n=e.length;t<n;t++)i=e[t],null!==i&&isFinite(i)&&(r=B.min(r,i),o=B.max(o,i));return{min:r===z?void 0:r,max:o===P?void 0:o}}function b(e){if(e)return e[e.length-1]}function w(e,t){return e.push.apply(e,t),e}function y(e){return L.template(e,{useWithBlock:!1,paramName:"d"})}function _(t,n){return e(n)&&null!==n?" "+t+"='"+n+"' ":""}function k(e){var t,n="";for(t=0;t<e.length;t++)n+=_(e[t][0],e[t][1]);return n}function x(t){var n,i,r="";for(n=0;n<t.length;n++)i=t[n][1],e(i)&&(r+=t[n][0]+":"+i+";");if(""!==r)return r}function C(e){return"string"!=typeof e&&(e+="px"),e}function F(e){var t,n,i=[];if(e)for(t=L.toHyphens(e).split("-"),n=0;n<t.length;n++)i.push("k-pos-"+t[n]);return i.join(" ")}function R(t){return""===t||null===t||"none"===t||"transparent"===t||!e(t)}function S(e){for(var t={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},n=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";e>0;)e<n[0]?n.shift():(i+=t[n[0]],e-=n[0]);return i}function E(e){var t,n,i,r,o;for(e=e.toLowerCase(),t={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},n=0,i=0,r=0;r<e.length;++r){if(o=t[e.charAt(r)],!o)return null;n+=o,o>i&&(n-=2*i),i=o}return n}function A(e){var t=Object.create(null);return function(){var n,i="";for(n=arguments.length;--n>=0;)i+=":"+arguments[n];return i in t?t[i]:t[i]=e.apply(this,arguments)}}function M(e){for(var t,n,i=[],r=0,o=e.length;r<o;)t=e.charCodeAt(r++),t>=55296&&t<=56319&&r<o?(n=e.charCodeAt(r++),56320==(64512&n)?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),r--)):i.push(t);return i}function D(e){return e.map(function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}).join("")}function T(e,t){function n(e,n){for(var i=[],r=0,o=0,s=0;r<e.length&&o<n.length;)t(e[r],n[o])<=0?i[s++]=e[r++]:i[s++]=n[o++];return r<e.length&&i.push.apply(i,e.slice(r)),o<n.length&&i.push.apply(i,n.slice(o)),i}return e.length<2?e.slice():function i(e){var t,r,o;return e.length<=1?e:(t=Math.floor(e.length/2),r=e.slice(0,t),o=e.slice(t),r=i(r),o=i(o),n(r,o))}(e)}var B=Math,L=window.kendo,N=L.deepExtend,I=B.PI/180,z=Number.MAX_VALUE,P=-Number.MAX_VALUE,H="undefined",$=Date.now;$||($=function(){return(new Date).getTime()}),N(L,{util:{MAX_NUM:z,MIN_NUM:P,append:w,arrayLimits:d,arrayMin:f,arrayMax:p,defined:e,deg:o,hashKey:c,hashObject:h,isNumber:s,isTransparent:R,last:b,limitValue:i,now:$,objectKey:u,round:t,rad:r,renderAttr:_,renderAllAttr:k,renderPos:F,renderSize:C,renderStyle:x,renderTemplate:y,sparseArrayLimits:v,sparseArrayMin:m,sparseArrayMax:g,sqr:l,valueOrDefault:a,romanToArabic:E,arabicToRoman:S,memoize:A,ucs2encode:D,ucs2decode:M,mergeSort:T}}),L.drawing.util=L.util,L.dataviz.util=L.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function t(){return{width:0,height:0,baseline:0}}function n(e,t,n){return h.current.measure(e,t,n)}function i(e,t){var n=[];if(e.length>0&&document.fonts){try{n=e.map(function(e){return document.fonts.load(e)})}catch(i){o.logToConsole(i)}Promise.all(n).then(t,t)}else t()}var r=document,o=window.kendo,s=o.Class,a=o.util,l=a.defined,u=s.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var n=this,i=n._map,r={key:e,value:t};i[e]=r,n._head?(n._tail.newer=r,r.older=n._tail,n._tail=r):n._head=n._tail=r,n._length>=n._size?(i[n._head.key]=null,n._head=n._head.newer,n._head.older=null):n._length++},get:function(e){var t=this,n=t._map[e];if(n)return n===t._head&&n!==t._tail&&(t._head=n.newer,t._head.older=null),n!==t._tail&&(n.older&&(n.older.newer=n.newer,n.newer.older=n.older),n.older=t._tail,n.newer=null,t._tail.newer=n,t._tail=n),n.value}}),c=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],h=s.extend({init:function(e){this._cache=new u(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(n,i,o){var s,u,h,d,f,p,m,g;if(!n)return t();if(s=a.objectKey(i),u=a.hashKey(n+s),h=this._cache.get(u),h)return h;d=t(),f=o?o:c,p=this._baselineMarker().cloneNode(!1);for(m in i)g=i[m],l(g)&&(f.style[m]=g);return e(f).text(n),f.appendChild(p),r.body.appendChild(f),(n+"").length&&(d.width=f.offsetWidth-this.options.baselineMarkerSize,d.height=f.offsetHeight,d.baseline=p.offsetTop+this.options.baselineMarkerSize),d.width>0&&d.height>0&&this._cache.put(u,d),f.parentNode.removeChild(f),d},_baselineMarker:function(){return e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});h.current=new h,o.util.TextMetrics=h,o.util.LRUCache=u,o.util.loadFonts=i,o.util.measureText=n}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/parse-xml.min",["kendo.core.min","util/main.min"],e)}(function(){"use strict";function e(e){var t,n=[];for(t=0;t<e.length;++t)n.push(e.charCodeAt(t));return n}function t(e,t){t>65535?(t-=65536,e.push(t>>>10&1023|55296,56320|1023&t)):e.push(t)}function n(e,n){function C(n){var i=e[W++];240&i^240?224&i^224?192&i^192?n.push(i):t(n,(31&i)<<6|63&e[W++]):t(n,(15&i)<<12|(63&e[W++])<<6|63&e[W++]):t(n,(3&i)<<18|(63&e[W++])<<12|(63&e[W++])<<6|63&e[W++])}function F(e){throw Error(e+", at "+W)}function R(t){for(var n=[];W<e.length&&t(e[W]);)n.push(e[W++]);return n}function S(e){return i.apply(0,R(e))}function E(){R(D)}function A(t){var n,i=W;for(n=0;n<t.length;++n)if(e[W++]!=t[n])return W=i,!1;return t}function M(e){A(e)||F("Expecting "+e.join(", "))}function D(e){return 9==e||10==e||13==e||32==e}function T(e){return e>=48&&e<=57}function B(e){return e>=48&&e<=57||(e|=32)>=97&&e<=102}function L(e){return 58==e||95==e||(e|=32)>=97&&e<=122}function N(e){return 45==e||T(e)||L(e)}function I(){for(var t=[];W<e.length;){if(A(a))return q("comment",i.apply(0,t));C(t)}}function z(){var e,t;A(d)?O():A(l)?I():(e=H(),t=U(e),j.push(t),A(u)?q("enter",e,t,!0):(M(p),q("enter",e,t),P(e),e!=H()&&F("Bad closing tag"),q("leave",e,t),E(),M(p)),j.pop())}function P(t){for(var n=[];W<e.length;){if(A(c))return n.length&&q("text",i.apply(0,n));if(A(o))for(;W<e.length&&!A(s);)C(n);else A(f)?(n.length&&q("text",i.apply(0,n)),z(),n=[]):A(v)?V(n):C(n)}F("Unclosed tag "+t)}function H(){return L(e[W])||F("Expecting XML name"),S(N)}function $(){var t,n=A(b)||A(w);for(n||F("Expecting string"),t=[];W<e.length;){if(A(n))return i.apply(0,t);A(v)?V(t):C(t)}F("Unfinished string")}function V(e){var n,i;A(y)?(n=A(_)||A(k)?parseInt(S(B),16):parseInt(S(T),10),isNaN(n)&&F("Bad numeric entity")):(i=H(),n=r[i],void 0===n&&F("Unknown entity "+i)),t(e,n),M(m)}function O(){q("decl",H(),U()),M(h)}function U(t){for(var n,i={$tag:t};W<e.length&&(E(),n=e[W],63!=n&&62!=n&&47!=n);)i[H()]=(M(g),$());return i}function q(e,t,i,r){var o=n&&n[e];o&&o.call(K,t,i,r)}var W=0,j=[],K={is:function(e){for(var t=j.length,n=e.length;--t>=0&&--n>=0;)if(j[t].$tag!=e[n]&&"*"!=e[n])return!1;return n<0?j[j.length-1]:null},exit:function(){throw x},stack:j},J=[];for(C(J),65279!=J[0]&&(W=0);W<e.length;)E(),M(f),z(),E()}var i=String.fromCharCode,r={amp:38,lt:60,gt:62,quot:34,apos:39,nbsp:160},o=e("<![CDATA["),s=e("]]>"),a=e("-->"),l=e("!--"),u=e("/>"),c=e("</"),h=e("?>"),d=e("?"),f=e("<"),p=e(">"),m=e(";"),g=e("="),v=e("&"),b=e('"'),w=e("'"),y=e("#"),_=e("x"),k=e("X"),x={};kendo.util.parseXML=function(){try{return n.apply(this,arguments)}catch(e){if(e!==x)throw e}}},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var n,i,r,s,a,l,u,c="",h=0;for(e=t(e);h<e.length;)n=e.charCodeAt(h++),i=e.charCodeAt(h++),r=e.charCodeAt(h++),s=n>>2,a=(3&n)<<4|i>>4,l=(15&i)<<2|r>>6,u=63&r,isNaN(i)?l=u=64:isNaN(r)&&(u=64),c=c+o.charAt(s)+o.charAt(a)+o.charAt(l)+o.charAt(u);return c}function t(e){var t,n,i="";for(t=0;t<e.length;t++)n=e.charCodeAt(t),n<128?i+=r(n):n<2048?(i+=r(192|n>>>6),i+=r(128|63&n)):n<65536&&(i+=r(224|n>>>12),i+=r(128|n>>>6&63),i+=r(128|63&n));return i}var n=window.kendo,i=n.deepExtend,r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i(n.util,{encodeBase64:e,encodeUTF8:t})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var t=Math,n=window.kendo,i=n.deepExtend,r=e.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),n=r(e,t);return n!=-1&&t.splice(n,1),this},trigger:function(e,t){var n,i,r=this._observers;if(r&&!this._suspended)for(i=0;i<r.length;i++)n=r[i],n[e]&&n[e](t);return this},optionsChange:function(e){e=e||{},e.element=this,this.trigger("optionsChange",e)},geometryChange:function(){this.trigger("geometryChange",{element:this})},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};i(n,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/commands.min",["kendo.core.min","kendo.binder.min","kendo.window.min","kendo.list.min","kendo.tabstrip.min"],e)}(function(){!function(e){function t(e){var t=document.createElement("textarea");n(t).addClass("k-spreadsheet-clipboard").val(e).appendTo(document.body).focus().select(),document.execCommand("copy"),n(t).remove()}var n,i,r,o,s,a,l,u;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=e.spreadsheet.Command=e.Class.extend({init:function(e){this.options=e,this._workbook=e.workbook,this._property=e&&e.property,this._state={}},range:function(e){return void 0!==e&&this._setRange(e),this._range},_setRange:function(e){this._range=e},redo:function(){this.exec()},undo:function(){this.setState(this._state)},getState:function(){this._state=this.range().getState(this._property)},setState:function(e){this.range().setState(e)},_forEachCell:function(e){var t=this.range(),n=t._ref;n.forEach(function(n){t.sheet().forEach(n.toRangeRef(),e.bind(this))}.bind(this))}}),r=i.extend({init:function(e){i.fn.init.call(this,e),this._target=e.target,this._value=e.value},exec:function(){this.getState(),this.setState(this._value)}}),e.spreadsheet.ColumnWidthCommand=r.extend({getState:function(){this._state=this.range().sheet().columnWidth(this._target)},setState:function(e){this.range().sheet().columnWidth(this._target,e)}}),e.spreadsheet.RowHeightCommand=r.extend({getState:function(){this._state=this.range().sheet().rowHeight(this._target)},setState:function(e){this.range().sheet().rowHeight(this._target,e)}}),e.spreadsheet.HyperlinkCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._link=e.link},exec:function(){var e=this.range();this._prevLink=e.link(),e.link(this._link),null==e.value()&&(this._hasSetValue=!0,e.value(this._link))},undo:function(){var e=this.range();e.link(this._prevLink),this._hasSetValue&&e.value(null)}}),e.spreadsheet.GridLinesChangeCommand=r.extend({getState:function(){this._state=this._range.sheet().showGridLines()},setState:function(e){this._range.sheet().showGridLines(e)}}),o=e.spreadsheet.PropertyChangeCommand=i.extend({_setRange:function(e){i.prototype._setRange.call(this,e.skipHiddenCells())},init:function(e){i.fn.init.call(this,e),this._value=e.value},exec:function(){var e=this.range();e.enable()&&(this.getState(),e[this._property](this._value))}}),e.spreadsheet.ClearContentCommand=i.extend({exec:function(){this.getState(),this.range().clearContent()}}),e.spreadsheet.EditCommand=o.extend({init:function(e){e.property=e.property||"input",o.fn.init.call(this,e)},rejectState:function(e){return this.undo(),{title:e.title,body:e.message,reason:"error",type:"validationError"}},getState:function(){this._state=this.range().getState()},exec:function(){var t,n,i=this.range();if(!i.enable())return{reason:"error",type:"rangeDisabled"};if(t=this._value,this.getState(),"value"==this._property)return void i.value(t);try{if(i.link(null),""===t?i.value(null):(i.input(t),/\n/.test(i.value())&&i.wrap(!0)),i._adjustRowHeight(),n=i._getValidationState())return this.rejectState(n)}catch(r){if(r instanceof e.spreadsheet.calc.ParseError)return{title:"Error in formula",body:r+"",reason:"error"};throw r}}}),e.spreadsheet.TextWrapCommand=o.extend({init:function(e){e.property="wrap",o.fn.init.call(this,e),this._value=e.value},getState:function(){var e={};this.range().forEachRow(function(t){var n=t.topLeft().row;e[n]=t.sheet().rowHeight(n)}),this._state=this.range().getState(this._property),this._rowHeight=e},undo:function(){var e,t=this.range().sheet(),n=this._rowHeight;this.range().setState(this._state);for(e in n)t.rowHeight(e,n[e])}}),e.spreadsheet.AdjustDecimalsCommand=i.extend({init:function(e){this._decimals=e.value,e.property="format",i.fn.init.call(this,e)},exec:function(){var t=this.range().sheet(),n=this._decimals,i=e.spreadsheet.formatting;this.getState(),t.batch(function(){this.range().forEachCell(function(e,r,o){var s=o.format;(s||n>0)&&(s=i.adjustDecimals(s||"#",n),t.range(e,r).format(s))})}.bind(this))}}),e.spreadsheet.BorderChangeCommand=i.extend({init:function(e){e.property="border",i.fn.init.call(this,e),this._type=e.border,this._style=e.style},exec:function(){this.getState(),this[this._type](this._style)},noBorders:function(){var e=this.range();e.sheet().batch(function(){e.borderLeft(null).borderTop(null).borderRight(null).borderBottom(null)}.bind(this),{})},allBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderLeft(e).borderTop(e).borderRight(e).borderBottom(e)}.bind(this),{})},leftBorder:function(e){this.range().leftColumn().borderLeft(e)},rightBorder:function(e){this.range().rightColumn().borderRight(e)},topBorder:function(e){this.range().topRow().borderTop(e)},bottomBorder:function(e){this.range().bottomRow().borderBottom(e)},outsideBorders:function(e){var t=this.range();t.sheet().batch(function(){t.leftColumn().borderLeft(e),t.topRow().borderTop(e),t.rightColumn().borderRight(e),t.bottomRow().borderBottom(e)}.bind(this),{})},insideBorders:function(e){this.range().sheet().batch(function(){this.allBorders(e),this.outsideBorders(null)}.bind(this),{})},insideHorizontalBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderBottom(e),t.bottomRow().borderBottom(null)}.bind(this),{})},insideVerticalBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderRight(e),t.rightColumn().borderRight(null)}.bind(this),{})}}),e.spreadsheet.MergeCellCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._type=e.value},exec:function(){this.getState(),this[this._type]()},activate:function(e){this.range().sheet().activeCell(e)},getState:function(){this._state=this.range().getState()},undo:function(){"unmerge"!==this._type&&(this.range().unmerge(),this.activate(this.range().topLeft())),this.range().setState(this._state)},cells:function(){var e=this.range(),t=e._ref;e.merge(),this.activate(t)},horizontally:function(){var e=this.range().topRow()._ref;this.range().forEachRow(function(e){e.merge()}),this.activate(e)},vertically:function(){var e=this.range().leftColumn()._ref;this.range().forEachColumn(function(e){e.merge()}),this.activate(e)},unmerge:function(){var e=this.range(),t=e._ref.topLeft;e.unmerge(),this.activate(t)}}),e.spreadsheet.FreezePanesCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._type=e.value},exec:function(){this.getState(),this._topLeft=this.range().topLeft(),this[this._type]()},getState:function(){this._state=this.range().sheet().getState()},undo:function(){this.range().sheet().setState(this._state)},panes:function(){var e=this._topLeft,t=this.range().sheet();t.frozenColumns(e.col).frozenRows(e.row)},rows:function(){var e=this._topLeft,t=this.range().sheet();t.frozenRows(e.row)},columns:function(){var e=this._topLeft,t=this.range().sheet();t.frozenColumns(e.col)},unfreeze:function(){var e=this.range().sheet();e.frozenRows(0).frozenColumns(0)}}),e.spreadsheet.PasteCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=this._workbook.clipboard()},getState:function(){this._range=this._workbook.activeSheet().range(this._clipboard.pasteRef()),this._state=this._range.getState()},exec:function(){var e,t=this._clipboard.canPaste();return this._clipboard.menuInvoked=!0,t.canPaste?(this.getState(),this._clipboard.paste(),e=this._workbook.activeSheet().range(this._clipboard.pasteRef()),void e._adjustRowHeight()):t.menuInvoked?{reason:"error",type:"useKeyboard"}:t.pasteOnMerged?{reason:"error",type:"modifyMerged"}:t.overflow?{reason:"error",type:"overflow"}:{reason:"error"}}}),e.spreadsheet.AdjustRowHeightCommand=i.extend({exec:function(){var e=this.options,t=this._workbook.activeSheet(),n=e.range||t.range(e.rowIndex);n._adjustRowHeight()}}),e.spreadsheet.ToolbarPasteCommand=i.extend({exec:function(){return e.support.clipboard.paste?(this._workbook._view.clipboard.focus().select(),void document.execCommand("paste")):{reason:"error",type:"useKeyboard"}}}),e.spreadsheet.CopyCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},undo:n.noop,exec:function(){var e=this._clipboard.canCopy();if(this._clipboard.menuInvoked=!0,e.canCopy)this._clipboard.copy();else{if(e.menuInvoked)return{reason:"error",type:"useKeyboard"};if(e.multiSelection)return{reason:"error",type:"unsupportedSelection"}}}}),e.spreadsheet.ToolbarCopyCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},undo:n.noop,exec:function(){if(!e.support.clipboard.copy)return{reason:"error",type:"useKeyboard"};var n=this._workbook._view.clipboard;t(n.html()),n.trigger("copy")}}),e.spreadsheet.CutCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},exec:function(){this.range().enable()&&this._clipboard.canCopy()&&(this.getState(),this._clipboard.cut())}}),e.spreadsheet.AutoFillCommand=i.extend({init:function(e){i.fn.init.call(this,e)},origin:function(e){this._origin=e},exec:function(){var t=this.range();if(!t.enable())return{reason:"error",type:"rangeDisabled"};this.getState();try{t.fillFrom(this._origin)}catch(n){if(n instanceof e.spreadsheet.Range.FillError)return{reason:"error",type:n.code};throw n}}}),e.spreadsheet.ToolbarCutCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},exec:function(){if(!e.support.clipboard.copy)return{reason:"error",type:"useKeyboard"};var n=this._workbook._view.clipboard;t(n.html()),n.trigger("cut")}}),e.spreadsheet.FilterCommand=i.extend({undo:function(){this.range().filter(this._state)},exec:function(){var e=this.range();if(this._state=e.hasFilter(),e.hasFilter())e.filter(!1);else{if(e.intersectingMerged().length)return{reason:"error",type:"filterRangeContainingMerges"};e.filter(!0)}}}),e.spreadsheet.SortCommand=i.extend({undo:function(){var e=this.range().sheet();e.setState(this._state)},exec:function(){var e=this.range(),t=e.sheet(),n=t.activeCell(),i=this.options.sheet?n.topLeft.col:this.options.column||0,r="asc"===this.options.value;return this._state=t.getState(),this.options.sheet&&(e=this.expandRange()),e.intersectingMerged().length?{reason:"error",type:"sortRangeContainingMerges"}:void e.sort({column:i,ascending:r})},expandRange:function(){var t=this.range().sheet();return new e.spreadsheet.Range(t._sheetRef,t)}}),s=e.spreadsheet.ApplyFilterCommand=i.extend({column:function(){return this.options.column||0},undo:function(){var e=this.range().sheet();e.clearFilter(this.column()),this._state.length&&this.range().filter(this._state)},getState:function(){var e=this.range().sheet(),t=e.filter();t&&(this._state=t.columns.filter(function(e){return e.index==this.column()}.bind(this)))},exec:function(){var t,n,i=this.range(),r=this.column(),o=i.sheet().filter(),s=!1;this.options.valueFilter?n={column:r,filter:new e.spreadsheet.ValueFilter(this.options.valueFilter)}:this.options.customFilter&&(n={column:r,filter:new e.spreadsheet.CustomFilter(this.options.customFilter)}),this.getState(),o&&o.ref.eq(i._ref)&&o.columns.length?(o.columns.forEach(function(e){e.index===r&&(s=!0)}),t=o.columns.map(function(e){return e.index===r?n:{column:e.index,filter:e.filter}}),s||t.push(n)):t=n,i.filter(t)}}),e.spreadsheet.ClearFilterCommand=s.extend({exec:function(){var e=this.range(),t=this.column();this.getState(),e.clearFilter(t)}}),e.spreadsheet.HideLineCommand=i.extend({init:function(e){i.fn.init.call(this,e),this.axis=e.axis},undo:function(){var e=this.range().sheet();e.setAxisState(this._state)},exec:function(){var e=this.range().sheet();this._state=e.getAxisState(),"row"==this.axis?e.axisManager().hideSelectedRows():e.axisManager().hideSelectedColumns()}}),e.spreadsheet.UnHideLineCommand=e.spreadsheet.HideLineCommand.extend({exec:function(){var e=this.range().sheet();this._state=e.getAxisState(),"row"==this.axis?e.axisManager().unhideSelectedRows():e.axisManager().unhideSelectedColumns()}}),a=e.spreadsheet.DeleteCommand=i.extend({undo:function(){var e=this.range().sheet();e.setState(this._state)}}),e.spreadsheet.DeleteRowCommand=a.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),e.axisManager().deleteSelectedRows()}}),e.spreadsheet.DeleteColumnCommand=a.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),e.axisManager().deleteSelectedColumns()}}),l=i.extend({init:function(e){i.fn.init.call(this,e),this._value=e.value},undo:function(){var e=this.range().sheet();e.setState(this._state)}}),e.spreadsheet.AddColumnCommand=l.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),"left"===this._value?e.axisManager().addColumnLeft():e.axisManager().addColumnRight()}}),e.spreadsheet.AddRowCommand=l.extend({exec:function(){var e=this.range().sheet();return e.axisManager().canAddRow()?(this._state=e.getState(),void("above"===this._value?e.axisManager().addRowAbove():e.axisManager().addRowBelow())):{reason:"error",type:"shiftingNonblankCells"}}}),e.spreadsheet.EditValidationCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._value=e.value},exec:function(){this.range().validation(this._value)}}),e.spreadsheet.OpenCommand=i.extend({cannotUndo:!0,exec:function(){var e=this.options.file;return null===e.name.match(/.xlsx$/i)?{reason:"error",type:"openUnsupported"}:void this.options.workbook.fromFile(this.options.file)}}),e.spreadsheet.SaveAsCommand=i.extend({exec:function(){var e=this.options.name+this.options.extension;".xlsx"===this.options.extension?this.options.workbook.saveAsExcel({fileName:e}):".pdf"===this.options.extension&&this.options.workbook.saveAsPDF(n.extend(this.options.pdf,{workbook:this.options.workbook,fileName:e}))}}),u=i.extend({init:function(e){i.fn.init.call(this,e),this._name=e.name,this._value=e.value},getState:function(){this._state=this._workbook.nameDefinition(this._name)},setState:function(){this._workbook.nameDefinition(this._name,this._state),this._workbook.trigger("change",{recalc:!0})}}),e.spreadsheet.DefineNameCommand=u.extend({exec:function(){this.getState();try{this._workbook.defineName(this._name,this._value),this._workbook.trigger("change",{recalc:!0})}catch(e){return{title:"Error",body:e+"",reason:"error"}}}}),e.spreadsheet.DeleteNameCommand=u.extend({exec:function(){this.getState(),this._workbook.undefineName(this._name),this._workbook.trigger("change",{recalc:!0})}}))}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulabar.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n={wrapper:"k-spreadsheet-formula-bar"},i=e.ui.Widget.extend({init:function(n,r){e.ui.Widget.call(this,n,r),n=this.element.addClass(i.classNames.wrapper),this.formulaInput=new e.spreadsheet.FormulaInput(t("<div/>").appendTo(n))},destroy:function(){this.formulaInput&&this.formulaInput.destroy(),this.formulaInput=null}}),e.spreadsheet.FormulaBar=i,t.extend(!0,i,{classNames:n}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulainput.min",["kendo.core.min"],e)}(function(){!function(e,t){function n(e){return"("==e||"["==e||"{"==e}function i(e){return")"==e||"]"==e||"}"==e}function r(e,t){return"("==t?")"==e:"["==t?"]"==e:"{"==t&&"}"==e}function o(e,t){return e.begin<=t.begin&&e.end>=t.end}function s(t){return e.spreadsheet.calc.runtime.FUNCS[t.toLowerCase()]}function a(e,t){return!(!e||!t)&&("ref"==e.type&&"ref"==t.type?e.ref.eq(t.ref):e.value===t.value)}var l,u,c,h,d,f,p,m,g;e.support.browser.msie&&e.support.browser.version<9||(l=e.jQuery,u=e.ui.Widget,c=".kendoFormulaInput",h=e.keys,d={wrapper:"k-spreadsheet-formula-input",listWrapper:"k-spreadsheet-formula-list"},f=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],p={27:"esc",37:"left",39:"right",35:"end",36:"home",32:"spacebar"},m=/(^_|[^a-z0-9]$)/i,g=u.extend({init:function(e,t){u.call(this,e,t),e=this.element,e.addClass(g.classNames.wrapper).attr("contenteditable",!0).attr("spellcheck",!1).css("white-space","pre"),this.options.autoScale&&e.on("input",this.scale.bind(this)),this._highlightedRefs=[],this._staticTokens=[],this._formulaSource(),this._formulaList(),this._popup(),this._tooltip(),e.on("keydown",this._keydown.bind(this)).on("keyup",this._keyup.bind(this)).on("blur",this._blur.bind(this)).on("input click",this._input.bind(this)).on("focus",this._focus.bind(this)).on("paste",this._paste.bind(this))},options:{name:"FormulaInput",autoScale:!1,filterOperator:"startswith",scalePadding:30,minLength:1},events:["keyup","focus"],enable:function(e){return void 0===e?"true"===this.element.attr("contenteditable"):(this.enableEditing(e),void this.element.toggleClass("k-state-disabled",!e))},enableEditing:function(e){e?this.element.attr("contenteditable",e):this.element.removeAttr("contenteditable")},getPos:function(){function e(e,t){try{!function r(n){if(n===e)throw t;if(1==n.nodeType)for(var i=n.firstChild;i;i=i.nextSibling)r(i);else 3==n.nodeType&&(t+=n.nodeValue.length)}(i)}catch(n){return n}}var n,i=this.element[0],r=t.getSelection(),o=e(r.focusNode,r.focusOffset),s=e(r.anchorNode,r.anchorOffset);if(null!=o&&null!=s)return o>s&&(n=o,o=s,s=n),{begin:o,end:s,collapsed:o==s}},setPos:function(e,n){function i(e,t){return e.startOffset!=t.startOffset||e.endOffset!=t.endOffset||e.startContainer!=t.endContainer||e.endContainer!=t.endContainer}function r(e,t){try{!function i(e){var n,r;if(3==e.nodeType){if(n=e.nodeValue.length,n>=t)throw e;t-=n}else if(1==e.nodeType)for(r=e.firstChild;r;r=r.nextSibling)i(r)}(e)}catch(n){return{node:n,pos:t}}}var o,s,a,l=this.element[0];e=r(l,e),n=null!=n?r(l,n):e,e&&n&&(o=document.createRange(),o.setStart(e.node,e.pos),o.setEnd(n.node,n.pos),s=t.getSelection(),a=s.getRangeAt(0),i(o,a)&&(s.removeAllRanges(),s.addRange(o)))},end:function(){this.setPos(this.length())},home:function(){this.setPos(0)},length:function(){return this.value().length},_formulaSource:function(){var t,n,i=[];for(n in e.spreadsheet.calc.runtime.FUNCS)m.test(n)||(t=n.toUpperCase(),i.push({value:t,text:t}));this.formulaSource=new e.data.DataSource({data:i})},_formulaList:function(){this.list=new e.ui.StaticList(l("<ul />").addClass(g.classNames.listWrapper).insertAfter(this.element),{autoBind:!1,selectable:!0,change:this._formulaListChange.bind(this),dataSource:this.formulaSource,dataValueField:"value",template:"#:data.value#"}),this.list.element.on("mousedown",function(e){e.preventDefault()})},_formulaListChange:function(){var e,t,n,i=this._tokenContext();i&&!this._mute&&(e=i.token,t=this.list.value()[0],n={replace:!0,token:e,end:e.end},i.nextToken&&"("==i.nextToken.value||(t+="("),this._replaceAt(n,t),this.popup.close())},_popup:function(){this.popup=new e.ui.Popup(this.list.element,{anchor:this.element})},_blur:function(){this.popup.close(),clearTimeout(this._focusId),this.trigger("blur")},_isFormula:function(){return/^=/.test(this.value())},_keydown:function(e){var t=e.keyCode;p[t]?(this.popup.close(),this._navigated=!0):this._move(t)&&(this._navigated=!0,e.preventDefault()),this._keyDownTimeout=setTimeout(this._syntaxHighlight.bind(this))},_keyup:function(){var e,t=this.popup;this._isFormula()&&!this._navigated&&(e=((this._tokenContext()||{}).token||{}).value,this.filter(e),e&&this.formulaSource.view().length?(t[t.visible()?"position":"open"](),this.list.focusFirst()):t.close()),this._navigated=!1,this._syntaxHighlight(),this.trigger("keyup")},_input:function(){this._syntaxHighlight()},_focus:function(){this._focusTimeout=setTimeout(this._syntaxHighlight.bind(this)),this.trigger("focus")},_paste:function(n){var i,r,o;n.preventDefault(),i=this.getPos(),r=e.support.browser.msie?t.clipboardData.getData("Text"):n.originalEvent.clipboardData.getData("text/plain"),o=this.value(),o=o.substr(0,i.begin)+r+o.substr(i.end),this.value(o),this.setPos(i.begin+r.length),this.scale()},_move:function(e){var t=this.list,n=this.popup;if(n.visible()){if(e===h.DOWN)return t.focusNext(),t.focus()||t.focusFirst(),!0;if(e===h.UP)return t.focusPrev(),t.focus()||t.focusLast(),!0;if(e===h.ENTER)return t.select(t.focus()),n.close(),!0;if(e===h.TAB)return t.select(t.focus()),n.close(),!0;if(e===h.PAGEUP)return t.focusFirst(),!0;if(e===h.PAGEDOWN)return t.focusLast(),
!0}return e===h.ENTER},_tokenContext:function(){var t,n,i,r=this.getPos(),s=this.value();if(!s||!r||!r.collapsed)return null;for(t=e.spreadsheet.calc.tokenize(s,this.row(),this.col()),i=0;i<t.length;++i)if(n=t[i],o(n,r)&&/^(?:str|sym|func)$/.test(n.type))return{token:n,nextToken:t[i+1]};return null},_sync:function(){this._editorToSync&&this.isActive()&&this._editorToSync.value(this.value())},_textContainer:function(){var t=e.getComputedStyles(this.element[0],f);t.position="absolute",t.visibility="hidden",t.whiteSpace="pre",t.top=-3333,t.left=-3333,this._span=l("<span style='white-space: pre'/>").css(t).insertAfter(this.element)},_tooltip:function(){this._cellTooltip=l('<div class="k-widget k-tooltip" style="position:absolute; display:none">A1</div>').insertAfter(this.element)},tooltip:function(e){this._cellTooltip.text(e)},toggleTooltip:function(e){this._cellTooltip.toggle(e)},isActive:function(){return this.element[0]===e._activeElement()},filter:function(e){!e||e.length<this.options.minLength||(this._mute=!0,this.list.select(-1),this._mute=!1,this.formulaSource.filter({field:this.list.options.dataValueField,operator:this.options.filterOperator,value:e}))},hide:function(){this.enableEditing(!1),this.element.hide(),this._cellTooltip.hide()},show:function(){this.enableEditing(!0),this.element.show()},row:function(){if(this.activeCell)return this.activeCell.row},col:function(){if(this.activeCell)return this.activeCell.col},position:function(e){e&&(this.show(),this.element.css({top:e.top+1+"px",left:e.left+1+"px"}),this._cellTooltip.css({top:e.top-this._cellTooltip.height()-10+"px",left:e.left}))},resize:function(e){e&&this.element.css({width:e.width-1,height:e.height-1})},canInsertRef:function(e){var t,n=this._canInsertRef(e),i=n&&n.token;if(i)for(t=0;t<this._staticTokens.length;t++)if(a(i,this._staticTokens[t]))return null;return n},_canInsertRef:function(t){function i(e){return e.begin>l.begin}function r(e){if(e){if(/^(?:num|str|bool|sym|ref)$/.test(e.type))return{replace:!0,token:e,end:e.end};if(/^(?:op|punc|startexp)$/.test(e.type))return e.end==l.end?s(e,u[h+1]):s(u[h-1],e)}}function s(e,t){if(null==e)return null;if(null==t)return/^(?:op|startexp)$/.test(e.type)||n(e.value)?{token:e,end:l.end}:null;if(a){if("op"==e.type&&/^(?:punc|op)$/.test(t.type))return{token:e,end:l.end}}else{if("startexp"==e.type)return{token:e,end:l.end};if(/^(?:ref|op|punc)$/.test(e.type))return{token:e,end:l.end};if(/^(?:punc|op)$/.test(e.type))return/^[,;({]$/.test(e.value)?{token:e,end:l.end}:null}return!1}var a,l,u,c,h;if(this.popup.visible())return null;if(a=t,l=this.getPos(),l&&this._isFormula()){if(0===l.begin)return null;for(u=e.spreadsheet.calc.tokenize(this.value(),this.row(),this.col()),h=0;h<u.length;++h){if(c=u[h],o(c,l))return r(c);if(i(c))return s(u[h-1],c)}return s(c,null)}return null},refAtPoint:function(e){var t=this._canInsertRef();t&&this._replaceAt(t,""+e.simplify())},_replaceAt:function(e,t){var n,i=this.value(),r=e.token,o=i.substr(e.end);i=i.substr(0,e.replace?r.begin:e.end)+t,n=i.length,i+=o,this._value(i),this.setPos(n),this.scale(),this._syntaxHighlight(),this._sync()},syncWith:function(t){var n,i=this,r="input"+c,o=i._sync.bind(i);e.support.browser.msie&&(r="keydown"+c,n=function(){setTimeout(o)}),i._editorToSync=t,i.element.off(r).on(r,n||o)},scale:function(){var e,t,n=this.element;this._span||this._textContainer(),this._span.html(n.html()),e=this._span.width()+this.options.scalePadding,t=this._span.height(),e>n.width()&&n.width(e),t>n.height()&&n.height(t)},_value:function(e){this.element.text(e)},value:function(t){if(void 0===t){var n=this.element[0].innerText;return e.support.browser.mozilla&&(n=n.replace(/\n$/,"")),n}this._value(t),this._syntaxHighlight()},highlightedRefs:function(){return this._highlightedRefs.slice()},_syntaxHighlight:function(){var t,a=this.getPos(),l=this.value(),u=e.spreadsheet.Pane.classNames.series,c=[],h=0,d=[],f=[];if(!a||a.collapsed){if(!/^=/.test(l))return(this._staticTokens.length||this._highlightedRefs.length)&&(this._staticTokens=[],this._highlightedRefs=[],this.element.text(l)),void(this.popup&&this.popup.close());f=e.spreadsheet.calc.tokenize(l,this.row(),this.col()),f.forEach(function(e){if(e.active=!1,e.cls=["k-syntax-"+e.type],"ref"==e.type&&(e.colorClass=u[h++%u.length],e.cls.push(e.colorClass),c.push(e)),a&&"punc"==e.type)if(n(e.value))d.unshift(e);else if(i(e.value)){var l=d.shift();l?r(e.value,l.value)?(o(e,a)||o(l,a))&&(e.cls.push("k-syntax-paren-match"),l.cls.push("k-syntax-paren-match")):(e.cls.push("k-syntax-error"),l.cls.push("k-syntax-error")):e.cls.push("k-syntax-error")}a&&o(e,a)&&(e.cls.push("k-syntax-at-point"),e.active=!0,t=e),"func"!=e.type||s(e.value)||a&&o(e,a)||e.cls.push("k-syntax-error")}),f.reverse().forEach(function(t){var n=t.begin,i=t.end,r=e.htmlEncode(l.substring(n,i));l=l.substr(0,n)+"<span class='"+t.cls.join(" ")+"'>"+r+"</span>"+l.substr(i)}),this.element.html(l),a&&this.setPos(a.begin,a.end),t&&/^(?:startexp|op|punc)$/.test(t.type)&&this._setStaticTokens(f),this._highlightedRefs=c}},_setStaticTokens:function(e){var t,n;for(this._staticTokens=[],t=0;t<e.length;t++)n=e[t],/^(?:num|str|bool|sym|ref)$/.test(n.type)&&this._staticTokens.push(n)},destroy:function(){this._editorToSync=null,this.element.off(c),clearTimeout(this._focusTimeout),clearTimeout(this._keyDownTimeout),this._cellTooltip=null,this._span=null,this.popup.destroy(),this.popup=null,u.fn.destroy.call(this)},insertNewline:function(){var e=this.value(),t=this.getPos(),n=t.end==e.length;e=e.substr(0,t.begin)+(n?"\n\n":"\n"+e.substr(t.end)),this.value(e),this.setPos(t.begin+1)}}),e.spreadsheet.FormulaInput=g,l.extend(!0,g,{classNames:d}))}(kendo,window)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/eventlistener.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i,r,o,s;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n={8:"backspace",9:"tab",13:"enter",27:"esc",37:"left",38:"up",39:"right",40:"down",35:"end",36:"home",32:"spacebar",33:"pageup",34:"pagedown",46:"delete",113:":edit"},i=navigator.platform.toUpperCase().indexOf("MAC")>=0,r=function(e){return e>47&&e<58||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223},o=function(e){var t=e.keyCode,i=n[t];return!i&&r(t)&&(i=":alphanum"),!i&&e.key&&1==e.key.length&&(i=":alphanum"),i},s=e.Class.extend({init:function(e,n,i){if(this._handlers={},this.target=e,this._observer=n||window,this.keyDownProxy=this.keyDown.bind(this),this.mouseProxy=this.mouse.bind(this),this.threshold=5,this._pressLocation=null,e.on("keydown",this.keyDownProxy),e.on("contextmenu mousedown cut copy paste scroll wheel click dblclick focus",this.mouseProxy),t(document.documentElement).on("mousemove mouseup",this.mouseProxy),i)for(var r in i)this.on(r,i[r])},keyDown:function(e){this.handleEvent(e,o(e.originalEvent))},mouse:function(e){var t,n,i,r,o;e.which?t=3==e.which:e.button&&(t=2==e.button),n=e.type,"mousedown"===n&&(t?n="rightmousedown":this._pressLocation={x:e.pageX,y:e.pageY}),"mouseup"===n&&(t||(this._pressLocation=null)),"mousemove"===n&&this._pressLocation&&(i=this._pressLocation.x-e.pageX,r=this._pressLocation.y-e.pageY,o=Math.sqrt(i*i+r*r),o>this.threshold&&(n="mousedrag")),this.handleEvent(e,n)},handleEvent:function(e,t){var n,r,o="";e.mod=i?e.metaKey:e.ctrlKey&&!e.altKey,e.altKey&&(o+="alt+"),e.shiftKey&&(o+="shift+"),e.ctrlKey&&(o+="ctrl+"),o+=t,n=this._handlers["*+"+t],n&&n.call(this._observer,e,o),r=this._handlers[o],r&&r.call(this._observer,e,o)},on:function(e,t){var n=this._handlers;"string"==typeof t&&(t=this._observer[t]),"string"==typeof e&&(e=e.split(",")),e.forEach(function(e){n[e]=t})},destroy:function(){this.target.off("keydown",this.keyDownProxy),this.target.off("keydown",this.mouseProxy),t(document.documentElement).off("mousemove mouseup",this.mouseProxy)}}),e.spreadsheet.EventListener=s)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/rangelist.min",["kendo.core.min"],e)}(function(){!function(e){function t(e){return e}function n(e){if(e.left.level===e.level){var t=e;e=e.left,t.left=e.right,e.right=t}return e}function i(e){if(e.right.right.level===e.level){var t=e;e=e.right,t.right=e.left,e.left=t,e.level+=1}return e}function r(e,t){return e===c?new u(1,t,c,c):(e.value.start-t.start>0?e.left=r(e.left,t):e.right=r(e.right,t),i(n(e)))}function o(e,t){var r,s;if(e===c)return e;if(r=e.value.start-t.start,0===r)if(e.left!==c&&e.right!==c){for(s=e.left;s.right!==c;)s=s.right;e.value=s.value,e.left=o(e.left,e.value)}else e=e.left===c?e.right:e.left;else r>0?e.left=o(e.left,t):e.right=o(e.right,t);return(e.left.level<e.level-1||e.right.level<e.level-1)&&(e.level-=1,e.right.level>e.level&&(e.right.level=e.level),e=n(e),e.right=n(e.right),e.right.right=n(e.right.right),e=i(e),e.right=i(e.right)),e}function s(e,t){e!==c&&(s(e.left,t),t.push(e.value),s(e.right,t))}function a(e,t,n){if(e!==c){var i=e.value;t.start<i.start&&a(e.left,t,n),i.intersects(t)&&n.push(i),t.end>i.end&&a(e.right,t,n)}}function l(e,t,n){t!==c&&(l(e,t.left,n),e.insert(n(t.value)),l(e,t.right,n))}var u,c,h,d,f,p,m;e.support.browser.msie&&e.support.browser.version<9||(u=e.Class.extend({init:function(e,t,n,i){this.level=e,this.value=t,this.left=n,this.right=i}}),c=new function(){this.left=this,this.right=this,this.level=0},h=e.Class.extend({init:function(e,t,n){this.start=e,this.end=t,this.value=n},intersects:function(e){return e.start<=this.end&&e.end>=this.start}}),d=e.Class.extend({init:function(){this.root=c},insert:function(e){this.root=r(this.root,e)},remove:function(e){this.root=o(this.root,e)},findrange:function(e){for(var t=this.root;t!=c;)if(e<t.value.start)t=t.left;else{if(!(e>t.value.end))return t.value;t=t.right}return null},values:function(){var e=[];return s(this.root,e),e},intersecting:function(e,t){var n=[];return a(this.root,new h(e,t),n),n},map:function(e){var t=new d;return l(t,this.root,e),t},clone:function(){return this.map(t)},first:function(){for(var e=this.root;e.left!=c;)e=e.left;return e},last:function(){for(var e=this.root;e.right!=c;)e=e.right;return e}}),f=e.Class.extend({init:function(e,t,n){void 0===t?this.tree=e:(this.tree=new d,this.tree.insert(new h(e,t,n)))},values:function(){return this.tree.values()},map:function(e){return new f(this.tree.map(e))},intersecting:function(e,t){return this.tree.intersecting(e,t)},first:function(){return this.tree.first().value},last:function(){return this.tree.last().value},insert:function(e,t,n){return this.tree.insert(new h(e,t,n))},value:function(e,t,n){var i,r,o,s,a,l,u,c,h;if(void 0===n)return void 0===t&&(t=e),this.intersecting(e,t)[0].value;if(i=this.tree.intersecting(e-1,t+1),i.length)for(r=i[0],o=i[i.length-1],r.end<e&&(r.value===n?e=r.start:i.shift()),o.start>t&&(o.value===n?t=o.end:i.pop()),s=0,a=i.length;s<a;s++)l=i[s],u=l.value,c=l.start,h=l.end,this.tree.remove(l),c<e&&(u!==n?this.insert(c,e-1,u):e=c),h>t&&(u!==n?this.insert(t+1,h,u):t=h);this.insert(e,t,n)},expandedValues:function(e,t){var n,i=this.intersecting(e,t),r=[],o=0;for(n=e;n<=t;n++)i[o].end<n&&o++,r.push({index:n-e,value:i[o].value});return r},sortedIndices:function(e,t,n,i){var r=this.expandedValues(e,t),o=function(e,t){return e.value===t.value?e.index-t.index:n(e.value,t.value)};return i&&(o=function(e,t){var r=i[e.index],o=i[t.index];return r.value===o.value?n(e.value,t.value):e.index-t.index}),r.sort(o),r},sort:function(e,t,n){var i,r,o;if(1!==this.intersecting(e,t).length)for(i=this.expandedValues(e,t),r=0,o=n.length;r<o;r++)this.value(r+e,r+e,i[n[r].index].value)},copy:function(e,t,n){var i,r,o,s,a,l=this.intersecting(e,t),u=n;for(r=0,o=l.length;r<o;r++)s=l[r].start,s<e&&(s=e),a=l[r].end,a>t&&(a=t),i=u+(a-s),this.value(u,i,l[r].value),u=++i},iterator:function(e,t){return new p(e,t,this.intersecting(e,t))},getState:function(){return this.tree.clone()},setState:function(e){this.tree=e}}),p=e.Class.extend({init:function(e,t,n){this.start=e,this.end=t,this.index=0,this.ranges=n},unique:function(){return this.ranges.map(function(e){return e.value})},at:function(e){for(;this.ranges[this.index].end<e;)this.index++;return this.ranges[this.index].value},forEach:function(e){for(var t=this.start;t<=this.end;t++)e(this.at(t),t);this.index=0}}),m=f.extend({init:function(e,t,n){this.tree=new d,this.range=new h(e,t,n)},intersecting:function(e,t){var n,i,r,o=this.tree.intersecting(e,t),s=[];if(!o.length)return[this.range];for(i=0,r=o.length;i<r;i++)n=o[i],n.start>e&&s.push(new h(e,n.start-1,this.range.value)),s.push(n),e=n.end+1;return n.end<t&&s.push(new h(n.end+1,t,this.range.value)),s},insert:function(e,t,n){n!==this.range.value&&this.tree.insert(new h(e,t,n))},lastRangeStart:function(){var e=this.tree.root;if(e===c)return this.range.start;for(;e.right!==c;)e=e.right;return e.value.end+1}}),e.spreadsheet.RangeTree=d,e.spreadsheet.RangeList=f,e.spreadsheet.SparseRangeList=m,e.spreadsheet.ValueRange=h)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/propertybag.min",["kendo.core.min"],e)}(function(){!function(e){function t(e){return e.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}var n,i,r,o;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=e.Class.extend({init:function(e){this.list=e},get:function(e){return this.parse(this.list.value(e,e))},set:function(e,t,n){void 0===n&&(n=t,t=e),this.list.value(e,t,n)},parse:function(e){return e},copy:function(e,t,n){this.list.copy(e,t,n)},iterator:function(e,t){return this.list.iterator(e,t)}}),r=i.extend({set:function(e,t,n){this.list.value(e,t,JSON.stringify(n))},parse:function(e){return JSON.parse(e)}}),o=i.extend({init:function(e,t,n){i.prototype.init.call(this,e),this.validations=n,this.formats=t},set:function(n,i,r){r instanceof Date&&(r=e.spreadsheet.dateToNumber(r),this.formats.value(n,i,t(e.culture().calendar.patterns.d))),this.list.value(n,i,r)}}),e.spreadsheet.PropertyBag=e.Class.extend({specs:[{property:o,name:"value",value:null,sortable:!0,serializable:!0,depends:"format"},{property:i,name:"format",value:null,sortable:!0,serializable:!0},{property:i,name:"formula",value:null,sortable:!0,serializable:!0},{property:i,name:"background",value:null,sortable:!0,serializable:!0},{property:r,name:"borderBottom",value:null,sortable:!1,serializable:!0},{property:r,name:"borderRight",value:null,sortable:!1,serializable:!0},{property:r,name:"borderLeft",value:null,sortable:!1,serializable:!0},{property:r,name:"borderTop",value:null,sortable:!1,serializable:!0},{property:i,name:"color",value:null,sortable:!0,serializable:!0},{property:i,name:"fontFamily",value:null,sortable:!0,serializable:!0},{property:i,name:"underline",value:null,sortable:!0,serializable:!0},{property:i,name:"fontSize",value:null,sortable:!0,serializable:!0},{property:i,name:"italic",value:null,sortable:!0,serializable:!0},{property:i,name:"bold",value:null,sortable:!0,serializable:!0},{property:i,name:"textAlign",value:null,sortable:!0,serializable:!0},{property:i,name:"verticalAlign",value:null,sortable:!0,serializable:!0},{property:i,name:"wrap",value:null,sortable:!0,serializable:!0},{property:i,name:"validation",value:null,sortable:!1,serializable:!0},{property:i,name:"enable",value:null,sortable:!1,serializable:!0},{property:i,name:"link",value:null,sortable:!1,serializable:!0},{property:i,name:"editor",value:null,sortable:!1,serializable:!0}],init:function(t){this.properties={},this.lists={},this.specs.forEach(function(n){this.lists[n.name]=new e.spreadsheet.SparseRangeList(0,t,n.value)},this),this.specs.forEach(function(e){this.properties[e.name]=new e.property(this.lists[e.name],this.lists[e.depends])},this)},getState:function(){var e={};return this.specs.forEach(function(t){e[t.name]=this.lists[t.name].getState()},this),e},setState:function(e){this.specs.forEach(function(t){this.lists[t.name].setState(e[t.name])},this)},get:function(e,t){return void 0===t?this.lists[e]:this.properties[e].get(t)},set:function(e,t,n,i){this.properties[e].set(t,n,i)},fromJSON:function(e,t){var n,i;for(n=0;n<this.specs.length;n++)i=this.specs[n],i.serializable&&void 0!==t[i.name]&&this.set(i.name,e,e,t[i.name],!1)},copy:function(e,t,n){this.specs.forEach(function(i){this.properties[i.name].copy(e,t,n)},this)},iterator:function(e,t,n){return this.properties[e].iterator(t,n)},sortable:function(){return this.specs.filter(function(e){return e.sortable}).map(function(e){return this.lists[e.name]},this)},iterators:function(e,t){var n=this.specs.filter(function(e){return e.serializable});return n.map(function(n){var i=this.iterator(n.name,e,t);return{name:n.name,value:n.value,at:function(e){return n.property.fn.parse(i.at(e))}}},this)},forEach:function(e,t,n){var i,r,o,s,a,l=this.iterators(e,t);for(i=e;i<=t;i++){for(r={},o=0;o<l.length;o++)s=l[o],a=s.at(i),a!==s.value&&(r[s.name]=a);n(r)}},forEachProperty:function(e){for(var t in this.properties)e(this.properties[t])}}),e.spreadsheet.ALL_PROPERTIES=n.map(e.spreadsheet.PropertyBag.prototype.specs,function(e){return e.name}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/references.min",["kendo.core.min"],e)}(function(){"use strict";function e(t){var n=Math.floor(t/26)-1;return(n>=0?e(n):"")+String.fromCharCode(65+t%26)}function t(e){return/^[a-z0-9_]*$/i.test(e)?e:"'"+e.replace(/\x27/g,"\\'")+"'"}function n(n,i,r,o){var s="";return++i,isFinite(i)?null==o||2&o||(i="$"+i):i="",isFinite(r)?(s=e(r),null==o||1&o||(s="$"+s)):r="",n?t(n)+"!"+s+i:s+i}var i,r,o,s,a,l,u,c;kendo.support.browser.msie&&kendo.support.browser.version<9||(i=kendo.spreadsheet,r=kendo.Class,o=r.extend({type:"ref",sheet:"",clone:function(){return this},hasSheet:function(){return this._hasSheet},simplify:function(){return this},setSheet:function(e,t){return this.sheet=e,null!=t&&(this._hasSheet=t),this},absolute:function(){return this},relative:function(){return this},adjust:function(){return this},toString:function(){return this.relative(0,0,3,3).print(0,0)},forEach:function(e,t){e.call(t,this)},map:function(e,t){return e.call(t,this)},intersects:function(e){return this.intersect(e)!==s},isCell:function(){return!1},toRow:function(){return this},toColumn:function(){return this},first:function(){return this},lastRange:function(){return this},size:function(){return 1},rangeAt:function(){return this},nextRangeIndex:function(){return 0},previousRangeIndex:function(){return 0},eq:function(e){var t,n,i,r,o=this,a=e;if(o===s||a===s)return o===a;if((a instanceof l||a instanceof u&&!(o instanceof l))&&(o=e,a=this),o instanceof l)return a=a.simplify(),a instanceof l&&o.row==a.row&&o.col==a.col&&o.sheet==a.sheet;if(o instanceof u){if(a instanceof u)return a.topLeft.eq(o.topLeft)&&a.bottomRight.eq(o.bottomRight);if(a instanceof c)return a.single()&&o.eq(a.refs[0])}else if(o instanceof c&&a instanceof c){if(t=o.refs,n=a.refs,t.length!=n.length)return!1;for(i=0,r=t.length;i<r;i++)if(!t[i].eq(n[i]))return!1;return!0}return o===a},concat:function(e){return new c([this,e])},replaceAt:function(e,t){return t},forEachColumnIndex:function(e){this.forEachAxisIndex("col",e)},forEachRowIndex:function(e){this.forEachAxisIndex("row",e)},forEachAxisIndex:function(e,t){var n=[],i="row"===e?"forEachRow":"forEachColumn";this[i](function(t){var i=t.first()[e];n.indexOf(i)===-1&&n.push(i)}),n.sort(function(e,t){return e>t?1:e<t?-1:0}).forEach(t)},valid:function(){return!1},renameSheet:function(e,t){if(this.sheet&&this.sheet.toLowerCase()==e.toLowerCase())return this.sheet=t,!0}}),o.display=n,s=new(o.extend({init:function(){},print:function(){return"#NULL!"},eq:function(e){return e===this},forEach:function(){}})),a=o.extend({ref:"name",init:function(e){this.name=e},clone:function(){return new a(this.name).setSheet(this.sheet,this.hasSheet())},print:function(){var e=t(this.name);return this.hasSheet()&&(e=t(this.sheet)+"!"+e),e}}),l=o.extend({ref:"cell",init:function(e,t,n){this.row=e,this.col=t,this.rel=n||0},clone:function(){return new l(this.row,this.col,this.rel).setSheet(this.sheet,this.hasSheet())},intersect:function(e){return e instanceof l?this.eq(e)?this:s:e.intersect(this)},print:function(e,i,r){var o,s,a=this.col,l=this.row,u=this.rel;return null==e&&u?(s=this.hasSheet()?t(this.sheet)+"!":"",a=isFinite(a)?1&u?"C["+a+"]":"C"+(a+1):"",l=isFinite(l)?2&u?"R["+l+"]":"R"+(l+1):"",s+l+a):(o=this.absolute(e,i),r?(l=o.row%1048576,a=o.col%16384,l<0&&(l+=1048576),a<0&&(a+=16384),n(this._hasSheet&&this.sheet,l,a,u)):o.valid()?n(this._hasSheet&&this.sheet,o.row,o.col,u):"#REF!")},absolute:function(e,t){var n=this.clone();return n.rel&!1?n:(1&n.rel&&(n.col=(n.col+t)%16384),2&n.rel&&(n.row=(n.row+e)%1048576),n.rel=0,n)},toRangeRef:function(){return new u(this,this)},relative:function(e,t,n){var i,r;return null==n&&(n=this.rel),i=2&n?this.row-e:this.row,r=1&n?this.col-t:this.col,new l(i,r,n).setSheet(this.sheet,this.hasSheet())},height:function(){return 1},width:function(){return 1},toString:function(){return n(null,this.row,this.col,3)},isCell:function(){return!0},leftColumn:function(){return this},rightColumn:function(){return this},topRow:function(){return this},bottomRow:function(){return this},forEachRow:function(e){e(this.toRangeRef())},forEachColumn:function(e){e(this.toRangeRef())},adjust:function(e,t,n,i,r,o,a){var l=this.absolute(e,t);if(r){if(l.row>=o){if(a<0&&l.row<o-a)return s;l.row+=a}}else if(l.col>=o){if(a<0&&l.col<o-a)return s;l.col+=a}return null!=n&&null!=i&&(l=l.relative(n,i,this.rel)),l},valid:function(){if(this.rel)throw Error("valid() called on relative reference");var e=this.col,t=this.row;return!(isFinite(e)&&e<0||isFinite(t)&&t<0)}}),u=o.extend({ref:"range",init:function(e,t){e._hasSheet&&t._hasSheet&&e.sheet.toLowerCase()!=t.sheet.toLowerCase()&&(this.endSheet=t.sheet),this.topLeft=new l(e.row,e.col,e.rel),this.bottomRight=new l(t.row,t.col,t.rel),this.normalize()},clone:function(){return new u(this.topLeft.clone(),this.bottomRight.clone()).setSheet(this.sheet,this.hasSheet())},_containsRange:function(e){return this._containsCell(e.topLeft)&&this._containsCell(e.bottomRight)},_containsCell:function(e){return e.sheet==this.sheet&&e.row>=this.topLeft.row&&e.col>=this.topLeft.col&&e.row<=this.bottomRight.row&&e.col<=this.bottomRight.col},contains:function(e){if(e instanceof Array){var t=this;return e.some(function(e){return t.contains(e)})}return e instanceof l?this._containsCell(e):e instanceof u&&this._containsRange(e)},_intersectRange:function(e){var t,n,i,r,o,a,c,h;return this.sheet!=e.sheet?s:(t=this.topLeft.col,n=this.topLeft.row,i=this.bottomRight.col,r=this.bottomRight.row,o=e.topLeft.col,a=e.topLeft.row,c=e.bottomRight.col,h=e.bottomRight.row,t<=c&&o<=i&&n<=h&&a<=r?new u(new l(Math.max(n,a),Math.max(t,o)),new l(Math.min(r,h),Math.min(i,c))).setSheet(this.sheet,this.hasSheet()):s)},intersect:function(e){return e instanceof l?this._containsCell(e)?e:s:e instanceof u?this._intersectRange(e).simplify():e instanceof c?e.intersect(this):s},simplify:function(){return this.isCell()?new l(this.topLeft.row,this.topLeft.col,this.topLeft.rel).setSheet(this.sheet,this.hasSheet()):this},normalize:function(){var e,t=this.topLeft,n=this.bottomRight,i=t.row,r=t.col,o=n.row,s=n.col,a=2&t.rel,u=1&t.rel,c=2&n.rel,h=1&n.rel,d=!1;return i>o&&(d=!0,e=i,i=o,o=e,e=a,a=c,c=e),r>s&&(d=!0,e=r,r=s,s=e,e=u,u=h,h=e),d&&(this.topLeft=new l(i,r,u|a),this.bottomRight=new l(o,s,h|c)),this},print:function(e,n,i){if(i||this.absolute(e,n).valid()){var r=this.topLeft.print(e,n,i)+":"+this.bottomRight.print(e,n,i);return this.hasSheet()&&(r=t(this.sheet)+(this.endSheet?":"+t(this.endSheet):"")+"!"+r),r}return"#REF!"},absolute:function(e,t){return new u(this.topLeft.absolute(e,t),this.bottomRight.absolute(e,t)).setSheet(this.sheet,this.hasSheet())},relative:function(e,t,n,i){return null==i&&(i=n),new u(this.topLeft.relative(e,t,n),this.bottomRight.relative(e,t,i)).setSheet(this.sheet,this.hasSheet())},height:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error("Mixed relative/absolute references");return this.bottomRight.row-this.topLeft.row+1},width:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error("Mixed relative/absolute references");return this.bottomRight.col-this.topLeft.col+1},collapse:function(){return this.topLeft.toRangeRef()},leftColumn:function(){return new u(this.topLeft,new l(this.bottomRight.row,this.topLeft.col))},rightColumn:function(){return new u(new l(this.topLeft.row,this.bottomRight.col),this.bottomRight)},topRow:function(){return new u(this.topLeft,new l(this.topLeft.row,this.bottomRight.col))},bottomRow:function(){return new u(new l(this.bottomRight.row,this.topLeft.col),this.bottomRight)},toRangeRef:function(){return this},toRow:function(e){return e+=Math.max(0,this.topLeft.row),new u(new l(e,this.topLeft.col),new l(e,this.bottomRight.col)).setSheet(this.sheet,this.hasSheet())},toColumn:function(e){return e+=Math.max(0,this.topLeft.col),new u(new l(this.topLeft.row,e),new l(this.bottomRight.row,e)).setSheet(this.sheet,this.hasSheet())},toCell:function(e,t){return e+=Math.max(0,this.topLeft.row),t+=Math.max(0,this.topLeft.col),new l(e,t,0).setSheet(this.sheet,this.hasSheet())},forEachRow:function(e){var t,n=this.topLeft.row,i=this.bottomRight.row,r=this.topLeft.col,o=this.bottomRight.col;for(t=n;t<=i;t++)e(new u(new l(t,r),new l(t,o)))},forEachColumn:function(e){var t,n=this.topLeft.row,i=this.bottomRight.row,r=this.topLeft.col,o=this.bottomRight.col;for(t=r;t<=o;t++)e(new u(new l(n,t),new l(i,t)))},intersecting:function(e){return e.filter(function(e){return e.toRangeRef().intersects(this)},this)},union:function(e,t){var n,i=this.intersecting(e),r=this.topLeft.row,o=this.topLeft.col,s=this.bottomRight.row,a=this.bottomRight.col,c=!1;return i.forEach(function(e){e=e.toRangeRef(),e.topLeft.row<r&&(c=!0,r=e.topLeft.row),e.topLeft.col<o&&(c=!0,o=e.topLeft.col),e.bottomRight.row>s&&(c=!0,s=e.bottomRight.row),e.bottomRight.col>a&&(c=!0,a=e.bottomRight.col),t&&t(e)}),n=new u(new l(r,o),new l(s,a)),c?n.union(e,t):n},resize:function(e){function t(e){return e||0}var n=Math.max.bind(Math,0),i=this.topLeft.row+t(e.top),r=this.topLeft.col+t(e.left),o=this.bottomRight.row+t(e.bottom),a=this.bottomRight.col+t(e.right);return r<0&&a<0||i<0&&o<0?s:i<=o&&r<=a?new u(new l(n(i),n(r)),new l(n(o),n(a))):s},move:function(e,t){return new u(new l(this.topLeft.row+e,this.topLeft.col+t),new l(this.bottomRight.row+e,this.bottomRight.col+t))},first:function(){return this.topLeft},isCell:function(){return!this.endSheet&&this.topLeft.eq(this.bottomRight)},toString:function(){return this.topLeft+":"+this.bottomRight},adjust:function(e,t,n,i,r,o,a){var l=this.topLeft.adjust(e,t,n,i,r,o,a),c=this.bottomRight.adjust(e,t,n,i,r,o,a);return l===s&&c===s?s:(l===s?(l=this.topLeft.absolute(e,t),r?l.row=o:l.col=o,null!=n&&null!=i&&(l=l.relative(n,i,this.topLeft.rel))):c===s&&(c=this.bottomRight.absolute(e,t),r?c.row=o-1:c.col=o-1,null!=n&&null!=i&&(c=c.relative(n,i,this.bottomRight.rel))),new u(l,c).setSheet(this.sheet,this.hasSheet()).simplify())},valid:function(){return this.topLeft.valid()&&this.bottomRight.valid()}}),c=o.extend({init:function(e){this.refs=e,this.length=e.length},clone:function(){return new c(this.refs.slice())},intersect:function(e){var t,n,i=[];for(t=0;t<this.length;++t)n=e.intersect(this.refs[t]),n!==s&&i.push(n);return i.length>0?new c(i).simplify():s},simplify:function(){var e=new c(this.refs.reduce(function(e,t){return t=t.simplify(),t!==s&&e.push(t),e},[]));return e.empty()?s:e.single()?e.refs[0]:e},absolute:function(e,t){return new c(this.refs.map(function(n){return n.absolute(e,t)}))},forEach:function(e,t){this.refs.forEach(e,t)},toRangeRef:function(){return this.refs[0].toRangeRef()},contains:function(e){return this.refs.some(function(t){return t.contains(e)})},map:function(e,t){return new c(this.refs.map(e,t))},first:function(){return this.refs[0].first()},lastRange:function(){return this.refs[this.length-1]},size:function(){return this.length},single:function(){return 1==this.length},empty:function(){return 0===this.length},isCell:function(){return this.single()&&this.refs[0].isCell()},rangeAt:function(e){return this.refs[e]},nextRangeIndex:function(e){return e===this.length-1?0:e+1},previousRangeIndex:function(e){return 0===e?this.length-1:e-1},concat:function(e){return new c(this.refs.concat([e]))},print:function(e,t,n){return this.refs.map(function(i){return i.print(e,t,n)}).join(",")},replaceAt:function(e,t){var n=this.refs.slice();return n.splice(e,1,t),new c(n)},leftColumn:function(){return this.map(function(e){return e.leftColumn()})},rightColumn:function(){return this.map(function(e){return e.rightColumn()})},topRow:function(){return this.map(function(e){return e.topRow()})},bottomRow:function(){return this.map(function(e){return e.bottomRow()})},forEachRow:function(e){this.forEach(function(t){t.forEachRow(e)})},forEachColumn:function(e){this.forEach(function(t){t.forEachColumn(e)})},adjust:function(e,t,n,i,r,o,s){return this.map(function(a){return a.adjust(e,t,n,i,r,o,s)}).simplify()},toString:function(){return this.refs.map(function(e){return""+e}).join(", ")},valid:function(){for(var e=this.refs.length;--e>=0;)if(this.refs[e].valid())return!1;return!0},renameSheet:function(e,t){this.refs.forEach(function(n){n.renameSheet(e,t)})}}),i.NULLREF=s,i.SHEETREF=new u(new l(0,0),new l(1/0,1/0)),i.FIRSTREF=new l(0,0),i.Ref=o,i.NameRef=a,i.CellRef=l,i.RangeRef=u,i.UnionRef=c,i.SHEETREF.print=function(){return"#SHEET"})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/autofillcalculator.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i;e.support.browser.msie&&e.support.browser.version<9||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.Class.extend({init:function(e){this._grid=e},rectIsVertical:function(e,t,n,i){var r=this._grid.rectangle(e.toRangeRef()),o=this._grid.rectangle(t.toRangeRef());return Math.abs(o[i]-r[i])>Math.abs(r[n]-o[n])},autoFillDest:function(e,i){var r,o,s,a,l,u,c,h=e.topLeft,d=e.bottomRight,f=i.row>=h.row,p=i.col>=h.col;return r=f?p?4:3:p?2:1,4===r?(o=h,s=d,l=i.row>s.row||i.col>s.col,l&&(i=new n(Math.max(i.row,s.row),Math.max(i.col,s.col))),a=this.rectIsVertical(s,i,"right","bottom")?new n(i.row,s.col):new n(s.row,i.col)):3===r?(u=new n(h.col,d.row),i.row>d.row&&this.rectIsVertical(u,i,"left","bottom")?(o=h,a=new n(i.row,d.col)):(o=d,a=new n(h.row,i.col))):2===r?(c=new n(h.row,d.col),i.col>d.col&&!this.rectIsVertical(c,i,"right","top")?(o=h,a=new n(d.row,i.col)):(o=d,a=new n(i.row,h.col))):(o=d,a=this.rectIsVertical(h,i,"left","top")?new n(i.row,h.col):new n(h.row,i.col)),this._grid.normalize(new t(o,a))}}),e.spreadsheet.AutoFillCalculator=i)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/navigator.min",["kendo.core.min","spreadsheet/autofillcalculator.min"],e)}(function(){!function(e){var t,n,i,r;e.support.browser.msie&&e.support.browser.version<9||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.Class.extend({init:function(e,t,n,i){this.rangeGetter=n,this.prevLeft=function(n){var r=i(this.range(n)),o=this.range(t.prevVisible(r.topLeft[e]));return i(o).topLeft[e]},this.nextRight=function(n){var r=i(this.range(n)),o=this.range(t.nextVisible(r.bottomRight[e]));return i(o).bottomRight[e]},this.nextLeft=function(n){var r=i(this.range(n));return t.nextVisible(r.bottomRight[e])},this.prevRight=function(n){var r=i(this.range(n));return t.prevVisible(r.topLeft[e])}},boundary:function(e,t){this.top=e,this.bottom=t},range:function(e){return this.rangeGetter(e,this.top,this.bottom)}}),r=e.Class.extend({init:function(t){this._sheet=t,this.columns=this._sheet._grid._columns,this.autoFillCalculator=new e.spreadsheet.AutoFillCalculator(t._grid),this.colEdge=new i("col",this._sheet._grid._columns,this.columnRange.bind(this),this.union.bind(this)),this.rowEdge=new i("row",this._sheet._grid._rows,this.rowRange.bind(this),this.union.bind(this));
},height:function(e){this._viewPortHeight=e},union:function(e){return this._sheet.unionWithMerged(e)},columnRange:function(e,t,n){return this._sheet._ref(t,e,n-t,1)},rowRange:function(e,t,n){return this._sheet._ref(e,t,1,n-t)},selectionIncludesMergedCells:function(){return this._sheet.select().contains(this._sheet._mergedCells)},setSelectionValue:function(e){var t=this._sheet.selection();setTimeout(function(){t.value(e())})},selectAll:function(){this._sheet.select(this._sheet._sheetRef)},select:function(e,t,n){e=this.refForMode(e,t),n&&(e=this._sheet.select().concat(e)),this._sheet.select(e)},refForMode:function(e,t){var n=this._sheet._grid;switch(t){case"range":e=n.normalize(e);break;case"row":e=n.rowRef(e.row);break;case"column":e=n.colRef(e.col);break;case"sheet":e=this._sheet._sheetRef}return e},startSelection:function(e,n,i,r){if("autofill"==n)this._sheet.startAutoFill();else if(r&&"range"==n){var o=new t(this._sheet.activeCell().first(),e);this._sheet.select(o,!1,!1),this._sheet.startSelection()}else this._sheet.startSelection(),this.select(e,n,i)},completeSelection:function(){this._sheet.completeSelection()},selectForContextMenu:function(e,t){var n=this._sheet;n.select().contains(this.refForMode(e,t))||this.select(e,t)},modifySelection:function(e){var n,i,r=this.determineDirection(e),o=this._sheet,s=this._viewPortHeight,a=o._grid._rows,l=o._grid._columns,u=o.currentOriginalSelectionRange(),c=o.select().toRangeRef(),h=o.activeCell(),d=u.topLeft.clone(),f=u.bottomRight.clone();switch(this.colEdge.boundary(c.topLeft.row,c.bottomRight.row),this.rowEdge.boundary(c.topLeft.col,c.bottomRight.col),r){case"expand-left":d.col=this.colEdge.prevLeft(d.col),n=d;break;case"shrink-right":d.col=this.colEdge.nextLeft(d.col),n=d;break;case"expand-right":f.col=this.colEdge.nextRight(f.col),n=f;break;case"shrink-left":f.col=this.colEdge.prevRight(f.col),n=f;break;case"expand-up":d.row=this.rowEdge.prevLeft(d.row),n=d;break;case"shrink-down":d.row=this.rowEdge.nextLeft(d.row),n=d;break;case"expand-down":f.row=this.rowEdge.nextRight(f.row),n=f;break;case"shrink-up":f.row=this.rowEdge.prevRight(f.row),n=f;break;case"expand-page-up":d.row=a.prevPage(d.row,s);break;case"shrink-page-up":f.row=a.prevPage(f.row,s);break;case"expand-page-down":f.row=a.nextPage(f.row,s);break;case"shrink-page-down":d.row=a.nextPage(d.row,s);break;case"first-col":d.col=l.firstVisible(),f.col=h.bottomRight.col,n=d;break;case"last-col":f.col=l.lastVisible(),d.col=h.topLeft.col,n=f;break;case"first-row":d.row=a.firstVisible(),f.row=h.bottomRight.row,n=d;break;case"last-row":f.row=a.lastVisible(),d.row=h.topLeft.row,n=f;break;case"last":f.row=a.lastVisible(),f.col=l.lastVisible(),d=h.topLeft,n=f;break;case"first":d.row=a.firstVisible(),d.col=l.firstVisible(),f=h.bottomRight,n=d}return i=new t(d,f),this.union(i).intersects(h)?(n&&o.focus(n),void this.updateCurrentSelectionRange(i)):void this.modifySelection(r.replace("shrink","expand"))},moveActiveCell:function(e){var t=this._sheet,i=t.activeCell(),r=i.topLeft,o=i.bottomRight,s=t.originalActiveCell(),a=t._grid._rows,l=t._grid._columns,u=s.row,c=s.col;switch(e){case"left":c=l.prevVisible(r.col);break;case"up":u=a.prevVisible(r.row);break;case"right":c=l.nextVisible(o.col);break;case"down":u=a.nextVisible(o.row);break;case"first-col":c=l.firstVisible();break;case"last-col":c=l.lastVisible();break;case"first-row":u=a.firstVisible();break;case"last-row":u=a.lastVisible();break;case"last":u=a.lastVisible(),c=l.lastVisible();break;case"first":u=a.firstVisible(),c=l.firstVisible();break;case"next-page":u=a.nextPage(o.row,this._viewPortHeight);break;case"prev-page":u=a.prevPage(o.row,this._viewPortHeight)}t.select(new n(u,c))},navigateInSelection:function(e){for(var t,i=this._sheet,r=i.activeCell(),o=r.topLeft,s=i.originalActiveCell(),a=i._grid._rows,l=i._grid._columns,u=s.row,c=s.col,h=i.currentNavigationRange(),d=h.topLeft,f=h.bottomRight,p=!1,m=o.col,g=o.row;!p;){switch(t=new n(u,c),e){case"next":f.eq(t)?(h=i.nextNavigationRange(),u=h.topLeft.row,c=h.topLeft.col):(c=l.nextVisible(m,!0),c>f.col&&(c=d.col,u=a.nextVisible(u,!0)));break;case"previous":d.eq(t)?(h=i.previousNavigationRange(),u=h.bottomRight.row,c=h.bottomRight.col):(c=l.prevVisible(m,!0),c<d.col&&(c=f.col,u=a.prevVisible(u,!0)));break;case"lower":f.eq(t)?(h=i.nextNavigationRange(),u=h.topLeft.row,c=h.topLeft.col):(u=a.nextVisible(g,!0),u>f.row&&(u=d.row,c=l.nextVisible(c,!0)));break;case"upper":d.eq(t)?(h=i.previousNavigationRange(),u=h.bottomRight.row,c=h.bottomRight.col):(u=a.prevVisible(g,!0),u<d.row&&(u=f.row,c=l.prevVisible(c,!0)));break;default:throw Error("Unknown entry navigation: "+e)}p=!this.shouldSkip(u,c),m=c,g=u}i.singleCellSelection()?i.select(new n(u,c)):i.activeCell(new n(u,c))},extendSelection:function(e,n){var i,r=this._sheet,o=r._grid;return"autofill"===n?void this.resizeAutoFill(e):("range"===n?e=o.normalize(e):"row"===n?e=o.rowRef(e.row).bottomRight:"column"===n&&(e=o.colRef(e.col).bottomRight),i=r.originalActiveCell().toRangeRef(),void this.updateCurrentSelectionRange(new t(i.topLeft,e)))},shouldSkip:function(e,t){var i=new n(e,t),r=!1;return this._sheet.forEachMergedCell(function(e){e.intersects(i)&&!e.collapse().eq(i)&&(r=!0)}),r},resizeAutoFill:function(e){var t,n,i,r,o,s=this._sheet,a=s.select(),l=s._autoFillOrigin,u=this.autoFillCalculator.autoFillDest(a,e),c=this.punch(a,u);c||(r=s.range(u)._previewFillFrom(s.range(l)),r&&(n=r.direction,o=r.props,0===n||1==n?(i=o[o.length-1],t=i[i.length-1].value):2===n?(i=o[0],t=i[i.length-1].value):3===n&&(i=o[o.length-1],t=i[0].value))),s.updateAutoFill(u,c,t,n)},determineDirection:function(e){var t=this._sheet.currentSelectionRange(),n=this._sheet.activeCell(),i=n.topLeft.col==t.topLeft.col,r=n.bottomRight.col==t.bottomRight.col,o=n.topLeft.row==t.topLeft.row,s=n.bottomRight.row==t.bottomRight.row;switch(e){case"left":e=r?"expand-left":"shrink-left";break;case"right":e=i?"expand-right":"shrink-right";break;case"up":e=s?"expand-up":"shrink-up";break;case"down":e=o?"expand-down":"shrink-down";break;case"prev-page":e=s?"expand-page-up":"shrink-page-up";break;case"next-page":e=o?"expand-page-down":"shrink-page-down"}return e},updateCurrentSelectionRange:function(e){var t=this._sheet;t.select(t.originalSelect().replaceAt(t.selectionRangeIndex(),e),!1)},punch:function(e,i){var r,o,s;return i.topLeft.eq(e.topLeft)&&(i.bottomRight.row<e.bottomRight.row?(o=this.rowEdge.nextRight(i.bottomRight.row),r=new t(new n(o,e.topLeft.col),e.bottomRight)):i.bottomRight.col<e.bottomRight.col&&(s=this.colEdge.nextRight(i.bottomRight.col),r=new t(new n(e.topLeft.row,s),e.bottomRight))),r}}),e.spreadsheet.SheetNavigator=r)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/axismanager.min",["kendo.core.min"],e)}(function(){!function(e){if(!(e.support.browser.msie&&e.support.browser.version<9)){var t=e.Class.extend({init:function(e){this._sheet=e},forEachSelectedColumn:function(e){var t=this._sheet;t.batch(function(){t.select().forEachColumnIndex(function(n,i){e(t,n,i)})},{layout:!0,recalc:!0})},forEachSelectedRow:function(e){var t=this._sheet;t.batch(function(){t.select().forEachRowIndex(function(n,i){e(t,n,i)})},{layout:!0,recalc:!0})},includesHiddenColumns:function(e){return this._sheet._grid._columns.includesHidden(e.topLeft.col,e.bottomRight.col)},includesHiddenRows:function(e){return this._sheet._grid._rows.includesHidden(e.topLeft.row,e.bottomRight.row)},selectionIncludesHiddenColumns:function(){return this.includesHiddenColumns(this._sheet.select())},selectionIncludesHiddenRows:function(){return this.includesHiddenRows(this._sheet.select())},deleteSelectedColumns:function(){this.forEachSelectedColumn(function(e,t,n){e.deleteColumn(t-n)})},deleteSelectedRows:function(){this.forEachSelectedRow(function(e,t,n){e.deleteRow(t-n)})},hideSelectedColumns:function(){var t,n,i,r,o,s,a;for(this.forEachSelectedColumn(function(e,t){e.hideColumn(t)}),t=this._sheet,n=t.select().toRangeRef(),i=n.topLeft.col,r=n.bottomRight.col,o=null;;){if(s=r<t._columns._count,a=i>=0,!a&&!s)break;if(s&&!t.isHiddenColumn(r)){o=r;break}if(a&&!t.isHiddenColumn(i)){o=i;break}i--,r++}null!==o&&(n=new e.spreadsheet.RangeRef(new e.spreadsheet.CellRef(0,o),new e.spreadsheet.CellRef(t._rows._count-1,o)),t.range(n).select())},hideSelectedRows:function(){var t,n,i,r,o,s,a;for(this.forEachSelectedRow(function(e,t){e.hideRow(t)}),t=this._sheet,n=t.select().toRangeRef(),i=n.topLeft.row,r=n.bottomRight.row,o=null;;){if(s=r<t._rows._count,a=i>=0,!a&&!s)break;if(s&&!t.isHiddenRow(r)){o=r;break}if(a&&!t.isHiddenRow(i)){o=i;break}i--,r++}null!==o&&(n=new e.spreadsheet.RangeRef(new e.spreadsheet.CellRef(o,0),new e.spreadsheet.CellRef(o,t._columns._count-1)),t.range(n).select())},unhideSelectedColumns:function(){this.forEachSelectedColumn(function(e,t){e.unhideColumn(t)})},unhideSelectedRows:function(){this.forEachSelectedRow(function(e,t){e.unhideRow(t)})},addColumnLeft:function(){this.forEachSelectedColumn(function(e,t,n){e.insertColumn(t-n)})},addColumnRight:function(){this.forEachSelectedColumn(function(e,t,n){e.insertColumn(t+(n+1))})},canAddRow:function(){var e=this._sheet.select().toRangeRef(),t=e.height();return this._sheet.canInsertRow(0,t)},addRowAbove:function(){this.forEachSelectedRow(function(e,t,n){e.insertRow(t-n)})},addRowBelow:function(){this.forEachSelectedRow(function(e,t,n){e.insertRow(t+(n+1))})}});e.spreadsheet.AxisManager=t}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/clipboard.min",["kendo.core.min"],e)}(function(){!function(e){function t(){var e=new c(0,0,0);return{ref:e,mergedCells:[],data:[],foreign:!0,origRef:e.toRangeRef()}}function n(e,t,n,i){var r,o=e.data||(e.data=[]);o[t]||(o[t]=[]),o[t][n]=i,r=e.origRef.bottomRight,r.row=Math.max(r.row,t),r.col=Math.max(r.col,n)}function i(e){return e.origRef}function r(e){return e.replace(/^-(?:ms|moz|webkit)-/,"")}function o(e){var t={};return["borderBottom","borderRight","borderLeft","borderTop"].forEach(function(n){t[n]="none"==e[n+"Style"]?null:{size:1,color:e[n+"Color"]}}),t}function s(e){var t=window.getComputedStyle(e[0]),n=e[0].innerText,i=o(t),s={value:""===n?null:n,borderBottom:i.borderBottom,borderRight:i.borderRight,borderLeft:i.borderLeft,borderTop:i.borderTop,fontSize:parseInt(t["font-size"],10)};return"rgb(0, 0, 0)"!==t["background-color"]&&"rgba(0, 0, 0, 0)"!==t["background-color"]&&(s.background=t["background-color"]),"rgb(0, 0, 0)"!==t.color&&"rgba(0, 0, 0, 0)"!==t.color&&(s.color=t.color),"underline"==t["text-decoration"]&&(s.underline=!0),"italic"==t["font-style"]&&(s.italic=!0),"bold"==t["font-weight"]&&(s.bold=!0),"right"!==r(t["text-align"])&&(s.textAlign=r(t["text-align"])),"middle"!==t["vertical-align"]&&(s.verticalAlign=t["vertical-align"]),"normal"!==t["word-wrap"]&&(s.wrap=!0),s}function a(e){var i=t();return e.find(">tr, >tbody>tr").each(function(t,n){u(n).find(">td, >th").each(function(i,r){var o,s,a,l,c,h=parseInt(u(r).attr("rowspan"),10)-1||0,d=parseInt(u(r).attr("colspan"),10)-1||0,f="<td/>";if(h){for(s=t+h,a=t;a<=s;a++)if(l=e.find("tr").eq(a),a>t&&(f="<td class='rowspan'></td>",0===i?l.find("td").eq(i).after(f):(c=Math.min(l.find("td").length,i),l.find("td").eq(c-1).after(f))),d)for(o=i;o<d+i;o++)f="<td class='rowspan colspan'></td>",l.find("td").eq(o).after(f)}else if(d)for(o=i;o<d+i;o++)f="<td class='colspan'></td>",u(n).find("td").eq(o).after(f)})}),e.find(">tr, >tbody>tr").each(function(e,t){u(t).find(">td, >th").each(function(t,r){var o,a,l,c=parseInt(u(r).attr("rowspan"),10)-1||0,h=parseInt(u(r).attr("colspan"),10)-1||0;n(i,e,t,s(u(r))),(c||h)&&(o=String.fromCharCode(65+t),a=String.fromCharCode(65+t+h),l=o+(e+1)+":"+a+(e+1+c),i.mergedCells.push(l))})}),i}function l(e){var i,r,o,s,a=t();if(e.indexOf("\t")===-1&&e.indexOf("\n")==-1)n(a,0,0,{value:e});else for(i=e.split("\n"),r=0;r<i.length;r++)for(o=i[r].split("\t"),s=0;s<o.length;s++)n(a,r,s,{value:o[s]});return a}var u,c,h;e.support.browser.msie&&e.support.browser.version<9||(u=e.jQuery,c=e.spreadsheet.CellRef,h=e.Class.extend({init:function(t){this.workbook=t,this.origin=e.spreadsheet.NULLREF,this.iframe=document.createElement("iframe"),this.iframe.className="k-spreadsheet-clipboard-paste",this.menuInvoked=!0,this._external={},this._uid=e.guid(),document.body.appendChild(this.iframe)},canCopy:function(){var t={canCopy:!0},n=this.workbook.activeSheet().select();return n===e.spreadsheet.NULLREF&&(t.canCopy=!1),n instanceof e.spreadsheet.UnionRef&&(t.canCopy=!1,t.multiSelection=!0),this.menuInvoked&&(t.canCopy=!1,t.menuInvoked=!0),t},canPaste:function(){var t,n=this.workbook.activeSheet(),i=this.pasteRef(),r={canPaste:!0};return i===e.spreadsheet.NULLREF?(t=this.isExternal(),r.pasteOnMerged=this.intersectsMerged(),r.canPaste=!r.pasteOnMerged&&t,r):(i.eq(n.unionWithMerged(i))||(r.canPaste=!1,r.pasteOnMerged=!0),this.menuInvoked&&(r.canPaste=!1,r.menuInvoked=!0),(i.bottomRight.row>=n._rows._count||i.bottomRight.col>=n._columns._count)&&(r.canPaste=!1,r.overflow=!0),r)},intersectsMerged:function(){var e,t=this.workbook.activeSheet(),n=this.parse(this._external);return this.origin=i(n),e=this.pasteRef(),!e.eq(t.unionWithMerged(e))},copy:function(){var e=this.workbook.activeSheet();this.origin=e.select(),this.contents=e.selection().getState(),delete this._external.html,delete this._external.plain},cut:function(){var e=this.workbook.activeSheet();this.copy(),e.range(e.select()).clear()},pasteRef:function(){var e=this.workbook.activeSheet(),t=e.activeCell().first(),n=this.origin.first(),i=n.row-t.row,r=n.col-t.col;return this.origin.relative(i,r,3)},destroy:function(){document.body.removeChild(this.iframe)},paste:function(){var e,t={},n=this.workbook.activeSheet();this._isInternal()?t=this.contents:(t=this.parse(this._external),this.origin=i(t)),e=this.pasteRef(),n.range(e).setState(t,this),n.triggerChange({recalc:!0,ref:e})},external:function(e){return e&&(e.html||e.plain)?void(this._external=e):this._external},isExternal:function(){return!this._isInternal()},parse:function(e){var i,r,o,c=t();return e.html?(i=this.iframe.contentWindow.document,i.open(),i.write(e.html),i.close(),r=u(i).find("table:first"),r.length?c=a(r):e.plain?c=l(e.plain):(o=u(i.body).find(":not(style)"),n(c,0,0,s(o.text())))):c=l(e.plain),c},_isInternal:function(){var e,t;return void 0===this._external.html||(e=!!u("<div/>").html(this._external.html).find("table.kendo-clipboard-"+this._uid).length,t=!!u("<div/>").html(this._external.plain).find("table.kendo-clipboard-"+this._uid).length,!(!e&&!t))}}),e.spreadsheet.Clipboard=h)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/range.min",["kendo.core.min","util/text-metrics.min"],e)}(function(){!function(e){function t(e,n,i){for(;e<=n&&i(e);)e++;if(e>n)return[];for(var r=e+1;r<=n;++r)if(i(r))return[{begin:e,end:r-1}].concat(t(r+1,n,i));return[{begin:e,end:n}]}function n(e){return e.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}function i(t){return!/^=/.test(t)&&/number|percent/.test(e.spreadsheet.calc.parse(null,0,0,t).type)}function r(t,n,i,r){var o={baselineMarkerSize:0,width:n+"px","font-size":(i||12)+"px","word-break":r===!0?"break-all":"normal","white-space":r===!0?"pre-wrap":"pre"};return e.util.measureText(t,o,d).height}var o,s,a,l,u,c,h,d;e.support.browser.msie&&e.support.browser.version<9||(o=e.jQuery,s=e.spreadsheet.UnionRef,a=e.spreadsheet.CellRef,l=e.spreadsheet.RangeRef,u=["color","fontFamily","underline","italic","bold","textAlign","verticalAlign","background","format","link","editor"],c={borderTop:{complement:"borderBottom",direction:{top:-1,bottom:-1}},borderLeft:{complement:"borderRight",direction:{left:-1,right:-1}},borderRight:{complement:"borderLeft",direction:{left:1,right:1}},borderBottom:{complement:"borderTop",direction:{top:1,bottom:1}}},h=e.Class.extend({init:function(e,t){this._sheet=t,this._ref=e},clone:function(){return new h(this._ref.clone(),this._sheet)},skipHiddenCells:function(){var e=[],n=this,i=n._sheet,r=i.isHiddenRow.bind(i),o=i.isHiddenColumn.bind(i);return n._ref.forEach(function u(i){var c,h,d,f,p,m;if(i instanceof s)i.forEach(u);else for(i=n._normalize(i.toRangeRef()),c=i.topLeft,h=i.bottomRight,d=t(c.row,h.row,r),f=t(c.col,h.col,o),p=0;p<d.length;++p)for(m=0;m<f.length;++m)e.push(new l(new a(d[p].begin,f[m].begin),new a(d[p].end,f[m].end)))}),i.range(e.length>1?new s(e):e[0])},_normalize:function(e){return this._sheet._grid.normalize(e)},_set:function(e,t,n){var i=this,r=i._sheet;return i._ref.forEach(function(n){r._set(n.toRangeRef(),e,t)}),n||r.triggerChange({recalc:"formula"==e||"value"==e||"validation"==e,value:t,ref:i._ref}),i},_get:function(e){return this._sheet._get(this._ref.toRangeRef(),e)},_property:function(e,t){return void 0===t?this._get(e):this._set(e,t)},value:function(e){return void 0!==e&&this._set("formula",null,!0),this._property("value",e)},resize:function(e){var t=this._resizedRef(e);return new h(t,this._sheet)},_resizedRef:function(e){return this._ref.map(function(t){return t.toRangeRef().resize(e)})},_border:function(t,n){var i,r=c[t].complement,o=c[t].direction,s=this._sheet;return s.batch(function(){i=this._property(t,n),void 0!==n&&this._resizedRef(o).forEach(function(t){t!==e.spreadsheet.NULLREF&&new h(t,s)._property(r,null)})}.bind(this),{}),i},_collapsedBorder:function(t){var n=this._property(t),i=c[t].complement,r=c[t].direction;return this._resizedRef(r).forEach(function(t){if(!n&&t!==e.spreadsheet.NULLREF){var r=new h(t,this._sheet);n=r._property(i)}}.bind(this)),n},borderTop:function(e){return this._border("borderTop",e)},borderRight:function(e){return this._border("borderRight",e)},borderBottom:function(e){return this._border("borderBottom",e)},borderLeft:function(e){return this._border("borderLeft",e)},collapsedBorderTop:function(){return this._collapsedBorder("borderTop")},collapsedBorderRight:function(){return this._collapsedBorder("borderRight")},collapsedBorderBottom:function(){return this._collapsedBorder("borderBottom")},collapsedBorderLeft:function(){return this._collapsedBorder("borderLeft")},input:function(t){var r,o,s,a,l,u,c=this._get("format");return void 0!==t?(o=this._ref.toRangeRef().topLeft,r=e.spreadsheet.calc.parse(this._sheet.name(),o.row,o.col,t),this._sheet.batch(function(){var i=null;"exp"==r.type?i=e.spreadsheet.calc.compile(r):"@"!=c?"date"==r.type?this.format(r.format||n(e.culture().calendar.patterns.d)):"percent"==r.type?this.format(100*r.value==(100*r.value|0)?"0%":"0.00%"):r.format&&!c&&this.format(r.format):"string"!=r.type&&(r.value=t),this.formula(i),i||this.value(r.value)}.bind(this),{recalc:!0,value:t,ref:this._ref,editorChange:this._sheet.isInEditMode()}),this):(t=this._get("value"),s=this._get("formula"),a=c&&!s&&e.spreadsheet.formatting.type(t,c),s?t="="+s:c&&"date"==a&&(l=e.spreadsheet.formatting.text(t,c),r=e.spreadsheet.calc.parse(null,null,null,l),"number"==typeof r.value&&(u=e.spreadsheet.formatting.text(r.value,c),l==u))?t=l:"date"===a?t=e.toString(e.spreadsheet.numberToDate(t),e.culture().calendar.patterns.d):"percent"===a?t=100*t+"%":"string"==typeof t&&(/^[=']/.test(t)||/^(?:true|false)$/i.test(t)||i(t))&&(t="'"+t),t)},enable:function(e){return void 0===e?(e=!0,this._sheet.forEach(this._ref.toRangeRef(),function(t,n,i){i.enable===!1&&(e=!1)}),e):this._property("enable",e)},formula:function(e){if(void 0===e){var t=this._get("formula");return t?""+t:null}return this._property("formula",e)},validation:function(e){if(void 0===e){var t=this._get("validation");return t?t.toJSON():null}return this._property("validation",e)},_getValidationState:function(){var e,t,n,i=this._ref.toRangeRef(),r=i.topLeft.row,o=i.topLeft.col,s=i.bottomRight.row,a=i.bottomRight.col;for(e=o;e<=a;e++)for(t=r;t<=s;t++)if(n=this._sheet._validation(t,e),n&&"reject"===n.type&&n.value===!1)return n;return!1},merge:function(){return this._ref=this._sheet._merge(this._ref),this},unmerge:function(){var e=this._sheet._mergedCells;return this._ref.forEach(function(t){t.toRangeRef().intersecting(e).forEach(function(t){e.splice(e.indexOf(t),1)})}),this._sheet.triggerChange({}),this},select:function(){return this._sheet.select(this._ref),this},values:function(t){var n,i,r,o,a,l,u,c,h,d;if(this._ref instanceof s)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF){if(void 0!==t)throw Error("Unsupported for NULLREF.");return[]}if(n=this._ref.toRangeRef(),i=n.topLeft.row,r=n.topLeft.col,o=n.bottomRight.row,a=n.bottomRight.col,void 0===t){for(t=Array(n.height()),c=0;c<t.length;c++)t[c]=Array(n.width());for(l=r;l<=a;l++)for(u=i;u<=o;u++)t[u-i][l-r]=this._sheet._value(u,l);return t}for(this._sheet._set(n,"formula",null),l=r;l<=a;l++)for(u=i;u<=o;u++)h=t[u-i],h&&(d=h[l-r],void 0!==d&&this._sheet._value(u,l,d));return this._sheet.triggerChange({recalc:!0,ref:n}),this},_properties:function(t){var n,i,r,o,a,l,u,c,h,d,f;if(this._ref instanceof s)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF){if(void 0!==t)throw Error("Unsupported for NULLREF.");return[]}if(n=this._ref.toRangeRef(),i=n.topLeft.row,r=n.topLeft.col,o=n.bottomRight.row,a=n.bottomRight.col,c=this._sheet,void 0===t)return t=Array(n.height()),c.forEach(n,function(e,n,o){e-=i,n-=r;var s=t[e]||(t[e]=[]);s[n]=o}),t;for(n=n.clone(),d=function(e){var t=h[e];n.topLeft.row=n.bottomRight.row=u,n.topLeft.col=n.bottomRight.col=l,"value"==e&&c._set(n,"formula",null),c._set(n,e,t)},l=r;l<=a;l++)for(u=i;u<=o;u++)f=t[u-i],f&&(h=f[l-r],h&&Object.keys(h).forEach(d));return c.triggerChange({recalc:!0,ref:this._ref}),this},clear:function(e){var t=!e||!Object.keys(e).length,n=this._sheet,i={recalc:t||e&&e.contentsOnly===!0,ref:this._ref};return n.batch(function(){i.recalc&&this.formula(null),t&&this.validation(null),(t||e&&e.formatOnly===!0)&&(u.forEach(function(e){this[e](null)}.bind(this)),this.unmerge())}.bind(this),i),this},clearContent:function(){return this.clear({contentsOnly:!0})},clearFormat:function(){return this.clear({formatOnly:!0})},isSortable:function(){return!(this._ref instanceof s||this._ref===e.spreadsheet.NULLREF)},sort:function(t){if(this._ref instanceof s)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF)throw Error("Unsupported for NULLREF.");return void 0===t&&(t={column:0}),t=t instanceof Array?t:[t],this._sheet._sortBy(this._ref.toRangeRef(),t.map(function(e,t){return"number"==typeof e&&(e={column:e}),{index:void 0===e.column?t:e.column,ascending:void 0===e.ascending||e.ascending}})),this},isFilterable:function(){return!(this._ref instanceof s)},filter:function(e){if(this._ref instanceof s)throw Error("Unsupported for multiple ranges.");return e===!1?this.clearFilters():(e=e===!0?[]:e instanceof Array?e:[e],this._sheet._filterBy(this._ref.toRangeRef(),e.map(function(e,t){return{index:void 0===e.column?t:e.column,filter:e.filter}}))),this},clearFilter:function(e){this._sheet.clearFilter(e)},clearFilters:function(){var e,t=this._sheet.filter(),n=[];if(t){for(e=0;e<t.columns.length;e++)n.push(e);this._sheet.batch(function(){this.clearFilter(n),this._filter=null},{layout:!0,filter:!0})}},hasFilter:function(){var e=this._sheet.filter();return!!e},leftColumn:function(){return new h(this._ref.leftColumn(),this._sheet)},rightColumn:function(){return new h(this._ref.rightColumn(),this._sheet)},topRow:function(){return new h(this._ref.topRow(),this._sheet)},bottomRow:function(){return new h(this._ref.bottomRow(),this._sheet)},column:function(e){return new h(this._ref.toColumn(e),this._sheet)},row:function(e){return new h(this._ref.toRow(e),this._sheet)},forEachRow:function(e){this._ref.forEachRow(function(t){e(new h(t,this._sheet))}.bind(this))},forEachColumn:function(e){this._ref.forEachColumn(function(t){e(new h(t,this._sheet))}.bind(this))},sheet:function(){return this._sheet},topLeft:function(){return this._ref.toRangeRef().topLeft},intersectingMerged:function(){var e=this._sheet,t=[];return e._mergedCells.forEach(function(e){e.intersects(this._ref)&&t.push(""+e)}.bind(this)),t},getState:function(t){var n,i,r=this._ref.first(),o={ref:r,data:[],origRef:this._ref};return t?n="input"===t?["value","formula"]:"border"===t?["borderLeft","borderTop","borderRight","borderBottom"]:[t]:(n=e.spreadsheet.ALL_PROPERTIES,o.mergedCells=this.intersectingMerged()),i=o.data,this.forEachCell(function(e,t,o){var s={},a=e-r.row,l=t-r.col;i[a]||(i[a]=[]),i[a][l]=s,n.forEach(function(e){s[e]=void 0===o[e]?null:o[e]})}),o},setState:function(e,t){var n=this._sheet,i=this._ref.first(),r=e.ref.row-i.row,o=e.ref.col-i.col;n.batch(function(){e.mergedCells&&this.unmerge();var s=i.row;e.data.forEach(function(r,o){if(!t||t.isExternal()||!n.isHiddenRow(e.ref.row+o)){var a=i.col;r.forEach(function(r,l){var u,c;if(!t||t.isExternal()||!n.isHiddenColumn(e.ref.col+l)){if(u=t?n.range(s,a):n.range(i.row+o,i.col+l),u.enable()){for(c in r)"value"!=c&&(t&&"enable"==c||u._set(c,r[c]));if(!r.formula)if(t&&t.isExternal())try{null==r.value?u._set("value",null):u.input(r.value)}catch(h){u._set("value",r.value)}else u._set("value",r.value)}a++}}),s++}}),e.mergedCells&&e.mergedCells.forEach(function(e){e=n._ref(e).relative(r,o,3),n.range(e).merge()},this)}.bind(this),{recalc:!0})},_adjustRowHeight:function(){var t,n=this._sheet,i=this.getState(),r=[];for(t=0;t<i.mergedCells.length;t++)r.push(n.range(i.mergedCells[t]));this.forEachRow(function(t){if(!(t.topLeft().row>=t.sheet()._rows._count)){var i=t.sheet().rowHeight(t.topLeft().row);t.forEachCell(function(t,o,s){var a,l,u=n.range(t,o),c=0;for(a=0;a<r.length;a++)if(u._ref.intersects(r[a]._ref)){c+=s.width;break}l=Math.max(n.columnWidth(o),c),i=Math.max(i,e.spreadsheet.util.getTextHeight(s.value,l,s.fontSize,s.wrap))}),n.rowHeight(t.topLeft().row,Math.max(n.rowHeight(t.topLeft().row),i))}})},forEachCell:function(e){this._ref.forEach(function(t){this._sheet.forEach(t.toRangeRef(),e.bind(this))}.bind(this))},hasValue:function(){var e=!1;return this.forEachCell(function(t,n,i){0!==Object.keys(i).length&&(e=!0)}),e},wrap:function(t){return void 0===t?!!this._property("wrap"):(this.forEachRow(function(t){var n=t.sheet().rowHeight(t.topLeft().row);t.forEachCell(function(t,i,r){var o=this._sheet.columnWidth(i);null!==r.value&&void 0!==r.value&&(n=Math.max(n,e.spreadsheet.util.getTextHeight(r.value,o,r.fontSize,!0)))}),t.sheet().rowHeight(t.topLeft().row,n)}.bind(this)),this._property("wrap",t),this)},fontSize:function(t){return void 0===t?this._property("fontSize"):(this.forEachRow(function(n){var i=n.sheet().rowHeight(n.topLeft().row);n.forEachCell(function(n,r,o){var s=this._sheet.columnWidth(r);null!==o.value&&void 0!==o.value&&(i=Math.max(i,e.spreadsheet.util.getTextHeight(o.value,s,t,o.wrap)))}),n.sheet().rowHeight(n.topLeft().row,i)}.bind(this)),this._property("fontSize",t),this)},draw:function(e,t){this._sheet.draw(this,e,t)}}),o.each(u,function(e,t){h.prototype[t]=function(e){return this._property(t,e)}}),d=o('<div style="position: absolute !important; top: -4000px !important; height: auto !important;padding: 1px !important; margin: 0 !important; border: 1px solid black !important;line-height: normal !important; visibility: hidden !important;white-space: pre-wrap !important; word-break: break-all !important;" />')[0],e.spreadsheet.util={getTextHeight:r},e.spreadsheet.Range=h)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.min",["spreadsheet/references.min"],e)}(function(){"use strict";function e(t){return t instanceof e?t:void(this.code=t)}function t(e,t,n){for(var i,r=n(e),o=e;++e<t;)i=n(e),i>r&&(r=i,o=e);return o}function n(t,n){function r(e){var t,n,i,s;return u=e[0],t="{ ",Array.isArray(u)?(d+="while (i < args.length) { ",f+="while (i < args.length) { ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="while (i < args.length) { ",t+=e.map(r).join(""),t+="} ",t+="xargs = stack.pop(); ",f+="} ",d+="} "):"+"==u?(d+="while (i < args.length) { ",f+="while (i < args.length) { ",t+="if (i >= args.length) return new CalcError('N/A'); ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="do { ",t+=e.slice(1).map(r).join(""),t+="} while (i < args.length); ",t+="xargs = stack.pop(); ",f+="} ",d+="} "):"?"==u?t+="if (!("+l(e[1])+")) return new CalcError(err); ":(n=e[1],Array.isArray(n)&&/^#?collect/.test(n[0])?(i=n[2],o(),t+="try {var $"+u+" = this.cellValues(args.slice(i",i&&(t+=", i + "+i),t+=")).filter(function($"+u+"){ ","collect"==n[0]&&(t+="if ($"+u+" instanceof CalcError) throw $"+u+"; "),t+="return "+l(n[1])+"; }, this); ",t+=i?"i += "+i+"; ":"i = args.length; ",t+="xargs.push($"+u+")} catch(ex) { if (ex instanceof CalcError) return ex; throw ex; } ",f+="toResolve.push(args.slice(i)); "):"rest"==n?t+="xargs.push(args.slice(i)); i = args.length; ":((g=/^\*/.test(u))&&(v=!0,u=u.substr(1)),t+="var $"+u+" = args[i++]; ",s=!1,/!$/.test(n)?(n=n.substr(0,n.length-1),s=!0):t+="if ($"+u+" instanceof CalcError) return $"+u+"; ",t+=a(n,s)+"xargs.push($"+u+"); ")),t+="} "}function o(){return c?"$"+u:(m=!0,c=!0,f+="toResolve.push(args[i++]); ","($"+u+" = this.force($"+u+"))")}function s(e){return"("+(e?"(typeof "+o()+" == 'number' ? ($"+u+" = round($"+u+"), true) : false) || ":"(typeof "+o()+" == 'number') || ")+"(typeof $"+u+" == 'boolean') || (typeof $"+u+" == 'string' && !/^(?:=|true|false)/i.test($"+u+") ? (tmp = kendo.spreadsheet.calc.parse(0, 0, 0, $"+u+"), /^date|number|percent$/.test(tmp.type) ? ($"+u+" = +tmp.value, true) : false) : false))"}function a(e,t){c=!1;var n="if (!("+l(e)+")) { ";return c&&!t&&(n+=" if ($"+u+" instanceof CalcError) return $"+u+"; "),n+="return new CalcError(err); } ",c||(f+="i++; "),d+=g?"var $"+u+" = this.asMatrix(args[i]); if ($"+u+") { xargs.push($"+u+"); width = Math.max(width, $"+u+".width); height = Math.max(height, $"+u+".height); arrays.push(true) } else { xargs.push(args[i]); arrays.push(false); } i++; ":"xargs.push(args[i++]); arrays.push(false); ",n}function l(e){if(Array.isArray(e)){if("or"==e[0])return"("+e.slice(1).map(l).join(") || (")+")";if("and"==e[0])return"("+e.slice(1).map(l).join(") && (")+")";if("values"==e[0])return"("+e.slice(1).map(function(e){return o()+" === "+e}).join(") || (")+")";if("null"==e[0])return"("+l("null")+" ? (($"+u+" = "+e[1]+"), true) : false)";if("between"==e[0]||"[between]"==e[0])return"("+o()+" >= "+e[1]+" && $"+u+" <= "+e[2]+" ? true : ((err = 'NUM'), false))";if("(between)"==e[0])return"("+o()+" > "+e[1]+" && $"+u+" < "+e[2]+" ? true : ((err = 'NUM'), false))";if("(between]"==e[0])return"("+o()+" > "+e[1]+" && $"+u+" <= "+e[2]+" ? true : ((err = 'NUM'), false))";if("[between)"==e[0])return"("+o()+" >= "+e[1]+" && $"+u+" < "+e[2]+" ? true : ((err = 'NUM'), false))";if("assert"==e[0]){var t=e[2]||"N/A";return"(("+e[1]+") ? true : (err = "+JSON.stringify(t)+", false))"}if("not"==e[0])return"!("+l(e[1])+")";throw Error("Unknown array type condition: "+e[0])}if("number"==e||"datetime"==e)return s(!0);if("integer"==e||"date"==e)return"("+s()+" && (($"+u+" |= 0), true))";if("divisor"==e)return"("+s(!0)+" && ($"+u+" == 0 ? ((err = 'DIV/0'), false) : true))";if("number+"==e)return"("+s(!0)+" && ($"+u+" >= 0 ? true : ((err = 'NUM'), false)))";if("integer+"==e)return"("+s()+" && (($"+u+" |= 0) >= 0 ? true : ((err = 'NUM'), false)))";if("number++"==e)return"("+s(!0)+" && ($"+u+" > 0 ? true : ((err = 'NUM'), false)))";if("integer++"==e)return"("+s()+" && (($"+u+" |= 0) > 0 ? true : ((err = 'NUM'), false)))";if("string"==e)return"((typeof "+o()+" == 'string' || typeof $"+u+" == 'boolean' || typeof $"+u+" == 'number') ? ($"+u+" += '', true) : ($"+u+" === undefined ? (($"+u+" = ''), true) : false))";if("boolean"==e)return"(typeof "+o()+" == 'boolean')";if("logical"==e)return"(typeof "+o()+" == 'boolean' || (typeof $"+u+" == 'number' ? ($"+u+" = !!$"+u+", true) : false))";if("matrix"==e)return o(),"((m = this.asMatrix($"+u+")) ? ($"+u+" = m) : false)";if("#matrix"==e)return"((m = this.asMatrix($"+u+")) ? ($"+u+" = m) : false)";
if("ref"==e)return"($"+u+" instanceof kendo.spreadsheet.Ref)";if("area"==e)return"($"+u+" instanceof kendo.spreadsheet.CellRef || $"+u+" instanceof kendo.spreadsheet.RangeRef)";if("cell"==e)return"($"+u+" instanceof kendo.spreadsheet.CellRef)";if("null"==e)return"("+o()+" == null)";if("anyvalue"==e)return"("+o()+" != null && i <= args.length)";if("forced"==e)return"("+o()+", i <= args.length)";if("anything"==e)return"(i <= args.length)";if("blank"==e)return"("+o()+" == null || $"+u+" === '')";throw Error("Can't check for type: "+e)}var u,c,h,d="function arrayArgs(args) { var xargs = [], width = 0, height = 0, arrays = [], i = 0; ",f="function resolve(args, callback) { var toResolve = [], i = 0; ",p="'use strict'; function check(args) { var stack = [], tmp, xargs = [], i = 0, m, err = 'VALUE'; ",m=!1,g=!1,v=!1;return p+=n.map(r).join(""),p+="if (i < args.length) return new CalcError('N/A'); ",p+="return xargs; } ",d+="return { args: xargs, width: width, height: height, arrays: arrays }; } ",m?(f+="this.resolveCells(toResolve, callback); } ",h=Function("CalcError","round",p+f+d+" return { resolve: resolve, check: check, arrayArgs: arrayArgs };")):h=Function("CalcError","round",p+" return { check: check };"),h=h(e,i),v||delete h.arrayArgs,h}function i(e){return Math.round(1e15*e)/1e15}function r(e){return"number"==typeof e?i(e):e}function o(t,n,i){if(i instanceof e)return i;try{return n.apply(t,i)}catch(r){if(r instanceof e)return r;throw r}}function s(e,t,n,i){return function(r,s){function a(){var t,a,l,u,c,h,d;if(i&&(t=i.call(this,s),s=t.args,t.width>0&&t.height>0)){for(a=new T(this),l=0;l<t.height;++l)for(u=0;u<t.width;++u){for(c=[],h=0;h<s.length;++h)t.arrays[h]?(d=s[h],c[h]=d.get(l%d.height,u%d.width)):c[h]=s[h];c=n.call(this,c),a.set(l,u,o(this,e,c))}return r(a)}c=n.call(this,s),r(o(this,e,c))}t?t.call(this,s,a):a.call(this)}}function a(t,n,i,r){return function(o,s){function a(){var n,a,l,u,c,h,d,f,p;if(r&&(n=r.call(this,s),s=n.args,n.width>0&&n.height>0))for(a=new T(this),l=n.width*n.height,u=function(e,t){return function(n){if(a.set(e,t,n),--l,0===l)return o(a)}},c=0;c<n.height&&l>0;++c)for(h=0;h<n.width&&l>0;++h){for(d=[],f=0;f<s.length;++f)n.arrays[f]?(p=s[f],d[f]=p.get(c%p.height,h%p.width)):d[f]=s[f];if(d=i.call(this,d),d instanceof e){if(a.set(c,h,d),--l,0===l)return o(a)}else d.unshift(u(c,h)),t.apply(this,d)}else n=i.call(this,s),n instanceof e?o(n):(n.unshift(o),t.apply(this,n))}n?n.call(this,s,a):a.call(this)}}function l(e,t){return e=e.toLowerCase(),L[e]=t,{args:function(i,r){var o,a=n(e,i);return r&&(a.arrayArgs&&console.log(""+a.arrayArgs),a.resolve&&console.log(""+a.resolve),a.check&&console.log(""+a.check)),o=L[e]=s(t,a.resolve,a.check,a.arrayArgs),o.kendoSpreadsheetArgs=i,this},argsAsync:function(i,r){var o,s=n(e,i);return r&&(s.arrayArgs&&console.log(""+s.arrayArgs),s.resolve&&console.log(""+s.resolve),s.check&&console.log(""+s.check)),o=L[e]=a(t,s.resolve,s.check,s.arrayArgs),o.kendoSpreadsheetArgs=i,this}}}function u(e,t,n){return t++,(1461*(e+4800+((t-14)/12|0))/4|0)+(367*(t-2-12*((t-14)/12|0))/12|0)-(3*((e+4900+((t-14)/12|0))/100|0)/4|0)+n-32075}function c(e){var t,n,i,r,o,s,a;return t=e+68569,n=4*t/146097|0,t-=(146097*n+3)/4|0,r=4e3*(t+1)/1461001|0,t=t-(1461*r/4|0)+31,i=80*t/2447|0,s=t-(2447*i/80|0),t=i/11|0,o=i+2-12*t,a=100*(n-49)+r+t,o--,{year:a,month:o,date:s,day:(e+1)%7,ord:z[h(a)][o]+s}}function h(e){return e%4?0:e%100?1:e%400?0:1}function d(e){return h(e)?366:365}function f(e,t){return h(e)&&1==t?29:I[t]}function p(e){return c((0|e)+N)}function m(e,t,n){return u(e,t,n)-N}function g(e){var t,n,i,r,o=e-(0|e);return o<0&&o++,t=Math.round($*o),n=Math.floor(t/H),t-=n*H,i=Math.floor(t/P),t-=i*P,r=Math.floor(t/1e3),t-=1e3*r,{hours:n,minutes:i,seconds:r,milliseconds:t}}function v(e){var t=p(e),n=g(e);return new Date(t.year,t.month,t.date,n.hours,n.minutes,n.seconds,n.milliseconds)}function b(e,t,n,i){return(e+(t+(n+i/1e3)/60)/60)/24}function w(e){var t=b(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());return e=m(e.getFullYear(),e.getMonth(),e.getDate()),e<0?e-1+t:e+t}function y(e){return kendo.parseDate(e)||kendo.parseDate(e,["MMMM dd yyyy","MMMM dd yy","MMM dd yyyy","MMM dd yy","dd MMMM yyyy","dd MMMM yy","dd MMM yyyy","dd MMM yy","MMMM dd, yyyy","MMMM dd, yy","MMM dd, yyyy","MMM dd, yy","MMMM dd","MMM dd","MMMM yyyy","MMM yyyy","dd MMMM","dd MMM"])}function _(t){return function(n,i){return"string"==typeof n&&"string"!=typeof i&&(i=null==i?"":i+""),"string"!=typeof n&&"string"==typeof i&&(n=null==n?"":n+""),"number"==typeof n&&null==i&&(i=0),"number"==typeof i&&null==n&&(n=0),"string"==typeof n&&"string"==typeof i&&(n=n.toLowerCase(),i=i.toLowerCase()),typeof i==typeof n?t(n,i):new e("VALUE")}}var k,x,C,F,R,S,E,A,M,D,T,B,L,N,I,z,P,H,$,V,O,U;kendo.support.browser.msie&&kendo.support.browser.version<9||(k={},x=kendo.spreadsheet,x.calc=k,C=k.runtime={},F=kendo.Class,R=x.Ref,S=x.CellRef,E=x.RangeRef,A=x.UnionRef,M=x.NULLREF,e.prototype.toString=function(){return"#"+this.code+("NAME"==this.code?"?":"!")},D=F.extend({init:function(e,t,n,i){this.callback=e,this.formula=t,this.ss=n,this.parent=i},resolve:function(e){var t=this;e instanceof R?t.resolveCells([e],function(){t._resolve(e)}):t._resolve(e)},error:function(t){return new e(t)},_resolve:function(e){e=void 0===e?null:Array.isArray(e)?this.asMatrix(e):r(e);var t=this.formula;t.value=e,this.ss.onFormula(t)&&this.callback&&this.callback.call(t,e)},resolveCells:function(e,t){function n(e){e.exec(s.ss,function(){--r||t.call(s)},s)}function i(e){var t,n;for(t=0;t<e.length;++t)n=e[t],n.formula&&a.push(n.formula);return!0}var r,o,s=this,a=[];if(function l(e){var t,n;for(t=0;t<e.length;++t)n=e[t],n instanceof R&&i(s.getRefCells(n)),Array.isArray(n)&&l(n)}(e),!a.length)return t.call(s);for(r=a.length,o=0;o<a.length;++o)n(a[o])},cellValues:function(e,t){var n,i,r=[];for(n=0;n<e.length;++n)i=e[n],i instanceof R?(i=this.getRefData(i),r=r.concat(i)):Array.isArray(i)?r=r.concat(this.cellValues(i)):i instanceof T?r=r.concat(this.cellValues(i.data)):r.push(i);return t?t.apply(this,r):r},fetchName:function(t,n){var i,r=this.formula,o=this.ss.nameValue(t,r.sheet,r.row,r.col);o instanceof B?(o=o.clone(r.sheet,r.row,r.col,!0),i=new x.ValidationFormulaContext(this.ss.workbook),o.exec(i,n,this)):(o instanceof R&&(o=o.absolute(r.row,r.col),o.sheet||(o.sheet=r.sheet)),n(null==o?new e("NAME"):o))},force:function(e){return e instanceof R?this.getRefData(e):e},func:function(t,n,i){t=t.toLowerCase();var r=L[t];return r?r.call(this,n,i):void n(new e("NAME"))},bool:function(e){return e instanceof R&&(e=this.getRefData(e)),"string"==typeof e?"true"==e.toLowerCase():"number"==typeof e?0!==e:"boolean"==typeof e?e:null!=e},asMatrix:function(e){var t,n,i,r,o,s,a;return e instanceof T?e:(t=this,e instanceof E?(n=e.topLeft,i=n.row,r=n.col,o=t.getRefCells(e),s=new T(t),isFinite(e.width())&&(s.width=e.width()),isFinite(e.height())&&(s.height=e.height()),isFinite(i)||(i=0),isFinite(r)||(r=0),o.forEach(function(e){s.set(e.row-i,e.col-r,e.value)}),s):Array.isArray(e)&&e.length>0?(s=new T(t),a=0,e.forEach(function(e){var n=0,i=1;e.forEach(function(e){var r=e instanceof E;e instanceof R&&!r&&(e=t.getRefData(e)),(r||Array.isArray(e))&&(e=t.asMatrix(e)),e instanceof T?(e.each(function(e,t,i){s.set(a+t,n+i,e)}),i=Math.max(i,e.height),n+=e.width):s.set(a,n++,e)}),a+=i}),s):void 0)},getRefCells:function(e,t){var n=this.formula;return this.ss.getRefCells(e,t,n.sheet,n.row,n.col)},getRefData:function(e){var t=this.formula;return this.ss.getData(e,t.sheet,t.row,t.col)},workbook:function(){return this.ss.workbook}}),T=F.extend({init:function(e){this.context=e,this.height=0,this.width=0,this.data=[]},clone:function(){var e=new T(this.context);return e.height=this.height,e.width=this.width,e.data=this.data.map(function(e){return e.slice()}),e},get:function(e,t){var n=this.data[e],i=n?n[t]:null;return i instanceof R?this.context.getRefData(i):i},set:function(e,t,n){var i=this.data[e];null==i&&(i=this.data[e]=[]),i[t]=n,e>=this.height&&(this.height=e+1),t>=this.width&&(this.width=t+1)},each:function(e,t){var n,i,r;for(n=0;n<this.height;++n)for(i=0;i<this.width;++i)if(r=this.get(n,i),(t||null!=r)&&(r=e.call(this.context,r,n,i),void 0!==r))return r},map:function(e,t){var n=new T(this.context);return this.each(function(t,i,r){n.set(i,r,e.call(this,t,i,r))},t),n},eachRow:function(e){var t,n;for(t=0;t<this.height;++t)if(n=e.call(this.context,t),void 0!==n)return n},eachCol:function(e){var t,n;for(t=0;t<this.width;++t)if(n=e.call(this.context,t),void 0!==n)return n},mapRow:function(e){var t=new T(this.context);return this.eachRow(function(n){t.set(n,0,e.call(this.context,n))}),t},mapCol:function(e){var t=new T(this.context);return this.eachCol(function(n){t.set(0,n,e.call(this.context,n))}),t},toString:function(){return JSON.stringify(this.data)},transpose:function(){var e=new T(this.context);return this.each(function(t,n,i){e.set(i,n,t)}),e},unit:function(e){var t,n,i,r;for(this.width=this.height=e,t=this.data=Array(e),n=e;--n>=0;)for(i=t[n]=Array(e),r=e;--r>=0;)i[r]=n==r?1:0;return this},multiply:function(t){var n,i,r,o,s,a,l=this,u=new T(l.context);for(n=0;n<l.height;++n)for(i=0;i<t.width;++i){for(r=0,o=0;o<l.width;++o){if(s=l.get(n,o),a=t.get(o,i),"number"!=typeof s||"number"!=typeof a)throw new e("VALUE");r+=s*a}u.set(n,i,r)}return u},adds:function(e,t){var n,i,r,o,s=this,a=new T(s.context),l=t?-1:1;for(n=0;n<s.height;++n)for(i=0;i<s.width;++i)r=s.get(n,i),o=e.get(n,i),a.set(n,i,r+l*o);return a},determinant:function(){var e,t,n,i,r,o=this.clone().data,s=o.length,a=1;for(e=0;e<s;e++){for(t=e;t<s&&!o[t][e];t++);if(t==s)return 0;if(t!=e)for(a=-a,i=e;i<s;i++)r=o[e][i],o[e][i]=o[t][i],o[t][i]=r;for(n=e+1;n<s;n++)for(i=e+1;i<s;i++)o[n][i]-=o[e][i]*o[n][e]/o[e][e];a*=o[e][e]}return a},inverse:function(){var e,n,i,r,o,s,a=this.width,l=this.augment(new T(this.context).unit(a)),u=l.data;for(n=0;n<a;++n){if(i=t(n,a,function(e){return u[e][n]}),!u[i][n])return null;for(n!=i&&(e=u[n],u[n]=u[i],u[i]=e),r=n+1;r<a;++r){for(o=n+1;o<2*a;++o)u[r][o]-=u[n][o]*u[r][n]/u[n][n];u[r][n]=0}}for(r=0;r<a;++r)for(s=u[r][r],o=0;o<2*a;++o)u[r][o]/=s;for(n=a;--n>=0;)for(r=n;--r>=0;)if(u[r][n])for(o=2*a;--o>=a;)u[r][o]-=u[n][o]*u[r][n];return l.slice(0,a,a,a)},augment:function(e){var t=this.clone(),n=t.width;return e.each(function(e,i,r){t.set(i,r+n,e)}),t},slice:function(e,t,n,i){var r,o,s=new T(this.context);for(r=0;r<n;++r)for(o=0;o<i;++o)s.set(r,o,this.get(e+r,t+o));return s}}),B=F.extend({init:function(e,t,n,i,r,o){this.refs=e,this.handler=t,this.print=n,this.absrefs=null,this.sheet=i,this.row=r,this.col=o,this.onReady=[],this.pending=!1},clone:function(e,t,n,i){var r=e.toLowerCase(),o=this.refs;return(i||r!=this.sheet.toLowerCase())&&(o=o.map(function(t){return t.hasSheet()||t.sheet&&t.sheet.toLowerCase()==r||(t=t.clone().setSheet(e)),t})),new B(o,this.handler,this.print,e,t,n)},resolve:function(e){this.pending=!1,this.onReady.forEach(function(t){t(e)})},exec:function(t,n,i){if("value"in this)n&&n(this.value);else{n&&this.onReady.push(n);for(var r=new D(this.resolve,this,t,i);i;){if(i.formula===this)return this.pending=!1,void r.resolve(new e("CIRCULAR"));i=i.parent}if(this.pending)return;this.pending=!0,this.absrefs||(this.absrefs=this.refs.map(function(e){return e.absolute(this.row,this.col)},this)),this.handler.call(r)}},reset:function(){this.onReady=[],this.pending=!1,delete this.value},renameSheet:function(e,t){e=e.toLowerCase(),this.absrefs=null,this.sheet.toLowerCase()==e&&(this.sheet=t),this.refs.forEach(function(n){n.renameSheet(e,t)})},adjust:function(e,t,n,i){var r,o,s,a,l,u;e=e.toLowerCase(),r=this.row,o=this.col,s=this.sheet.toLowerCase(),a=!1,s==e&&("row"==t&&r>=n&&(this.row+=i,a=!0),"col"==t&&o>=n&&(this.col+=i,a=!0)),l=this.row,u=this.col,this.absrefs=null,this.refs=this.refs.map(function(s){return s===M?s:s.sheet.toLowerCase()!=e?(a&&("row"==t&&r>=n&&(s=s.relative(i,0)),"col"==t&&o>=n&&(s=s.relative(0,i))),s):s.adjust(r,o,l,u,"row"==t,n,i)},this)},toString:function(){return this.print(this.row,this.col)}}),L=Object.create(null),L["if"]=function(t,n){var i=this,r=n[0],o=n[1],s=n[2];this.resolveCells([r],function(){var n=i.asMatrix(r);n?o(function(r){s(function(o){var s=i.asMatrix(r),a=i.asMatrix(o);t(n.map(function(t,n,l){return t instanceof e?t:i.bool(t)?s?s.get(n,l):r:a?a.get(n,l):o}))})}):(r=this.force(r),r instanceof e?t(r):i.bool(r)?o(t):s(t))})},L["φ"]=function(e){e((1+Math.sqrt(5))/2)},N=u(1900,0,-1),I=[31,28,31,30,31,30,31,31,30,31,30,31],z=[[0,31,59,90,120,151,181,212,243,273,304,334],[0,31,60,91,121,152,182,213,244,274,305,335]],P=6e4,H=60*P,$=24*H,C.CalcError=e,C.Formula=B,C.Matrix=T,C.packDate=m,C.unpackDate=p,C.packTime=b,C.unpackTime=g,C.serialToDate=v,C.dateToSerial=w,C.daysInMonth=f,C.isLeapYear=h,C.daysInYear=d,C.parseDate=y,x.dateToNumber=w,x.numberToDate=v,x.defineFunction=l,x.CalcError=e,C.defineFunction=l,C.defineAlias=function(e,t){var n=L[t];if(!n)throw Error("Function "+t+" is not yet defined");n.kendoSpreadsheetAliases||(n.kendoSpreadsheetAliases=[t]),n.kendoSpreadsheetAliases.push(e),L[e]=n},C.FUNCS=L,V=["or","number",["null",0]],O=[["*a",V],["*b",V]],U=[["*a",["or","anyvalue",["null",0]]],["*b",["or","anyvalue",["null",0]]]],l("binary+",function(e,t){return e+t}).args(O),l("binary-",function(e,t){return e-t}).args(O),l("binary*",function(e,t){return e*t}).args(O),l("binary/",function(e,t){return e/t}).args([["*a",V],["*b","divisor"]]),l("binary^",function(e,t){return Math.pow(e,t)}).args(O),l("binary&",function(e,t){return null==e&&(e=""),null==t&&(t=""),""+e+t}).args([["*a",["or","number","string","boolean","null"]],["*b",["or","number","string","boolean","null"]]]),l("binary=",function(e,t){return e===t}).args(U),l("binary<>",function(e,t){return e!==t}).args(U),l("binary<",_(function(e,t){return e<t})).args(U),l("binary<=",_(function(e,t){return e<=t})).args(U),l("binary>",_(function(e,t){return e>t})).args(U),l("binary>=",_(function(e,t){return e>=t})).args(U),l("unary+",function(e){return e}).args([["*a",V]]),l("unary-",function(e){return-e}).args([["*a",V]]),l("unary%",function(e){return e/100}).args([["*a",V]]),l("binary:",function(e,t){return new E(e,t).setSheet(e.sheet||this.formula.sheet,e.hasSheet())}).args([["a","cell"],["b","cell"]]),l("binary,",function(e,t){return new A([e,t])}).args([["a","ref"],["b","ref"]]),l("binary ",function(e,t){return e.intersect(t)}).args([["a","ref"],["b","ref"]]),l("not",function(e){return!this.bool(e)}).args([["*a",["or","anyvalue",["null",0]]]]),l("isblank",function(e){return e instanceof S&&(e=this.getRefData(e),null==e)}).args([["*value","anything!"]]),l("iserror",function(t){return t instanceof e}).args([["*value","forced!"]]),l("iserr",function(t){return t instanceof e&&"N/A"!=t.code}).args([["*value","forced!"]]),l("isna",function(t){return t instanceof e&&"N/A"==t.code}).args([["*value","forced!"]]),l("islogical",function(e){return"boolean"==typeof e}).args([["*value","forced!"]]),l("isnontext",function(e){return"string"!=typeof e}).args([["*value","forced!"]]),l("istext",function(e){return"string"==typeof e}).args([["*value","forced!"]]),l("isnumber",function(e){return"number"==typeof e}).args([["*value","forced!"]]),l("isref",function(e){return e instanceof S||e instanceof E}).args([["*value","anything!"]]),L[",getname"]=function(e,t){this.fetchName(t[0],e)})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/validation.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e,t,r,a){var u,c,h,d;if("string"==typeof a&&(a=JSON.parse(a)),a.from&&("list"!==a.dataType||a.fromIsListValue||(a.from=kendo.format(o,a.from),a.fromIsListValue=!0),"date"===a.dataType&&(h=i.runtime.parseDate(a.from),h&&(a.from=kendo.format(s,a.from),a.fromIsDateValue=!0)),a.from=i.compile(i.parseFormula(e,t,r,a.from))),a.to&&("date"===a.dataType&&(d=i.runtime.parseDate(a.to),d&&(a.to=kendo.format(s,a.to),a.toIsDateValue=!0)),a.to=i.compile(i.parseFormula(e,t,r,a.to))),c="custom"==a.dataType?n.validationComparers.custom:"list"==a.dataType?n.validationComparers.list:n.validationComparers[a.comparerType],!c)throw kendo.format("'{0}' comparer is not implemented.",a.comparerType);return u=function(e){var t,n=this.to&&this.to_value?this.to_value:void 0;return null===e||""===e?this.value=!!this.allowNulls:"custom"==this.dataType?this.value=c(e,this.from_value,n):"list"==this.dataType?(t=this._getListData(),this.value=c(e,t,n)):this.value=c(e,this.from_value,n),this.value},new kendo.spreadsheet.validation.Validation(l.extend(a,{handler:u,sheet:e,row:t,col:r}))}var t,n,i,r,o,s,a,l=kendo.jQuery;kendo.support.browser.msie&&kendo.support.browser.version<9||(t=kendo.spreadsheet,n={},t.validation=n,i=t.calc,r=kendo.Class,o="_matrix({0})",s='DATEVALUE("{0}")',i.runtime.defineFunction("_matrix",function(e){return e}).args([["m","matrix"]]),a=r.extend({init:function(e){this.handler=e.handler,this.from=e.from,this.to=e.to,this.dataType=e.dataType,this.comparerType=e.comparerType,this.type=e.type?e.type:"warning",this.allowNulls=!!e.allowNulls,this.fromIsDateValue=!!e.fromIsDateValue,this.toIsDateValue=!!e.toIsDateValue,this.showButton=e.showButton,this.fromIsListValue=!!e.fromIsListValue,this.sheet=e.sheet,this.row=e.row,this.col=e.col,e.tooltipMessageTemplate&&(this.tooltipMessageTemplate=e.tooltipMessageTemplate),e.tooltipTitleTemplate&&(this.tooltipTitleTemplate=e.tooltipTitleTemplate),e.messageTemplate&&(this.messageTemplate=e.messageTemplate),e.titleTemplate&&(this.titleTemplate=e.titleTemplate)},_formatMessages:function(e){var t=this.from?this.from_value:"",n=this.to?this.to_value:"",i=this.from?""+this.from:"",r=this.to?""+this.to:"",o=this.dataType,s=this.type,a=this.comparerType;return kendo.format(e,t,n,i,r,o,s,a)},_setMessages:function(){this.title="",this.message="",this.tooltipTitleTemplate&&(this.tooltipTitle=this._formatMessages(this.tooltipTitleTemplate)),this.tooltipMessageTemplate&&(this.tooltipMessage=this._formatMessages(this.tooltipMessageTemplate)),this.titleTemplate&&(this.title=this._formatMessages(this.titleTemplate)),this.messageTemplate&&(this.message=this._formatMessages(this.messageTemplate))},_getListData:function(){var e,t,n,i,r;if(!this.from_value||!this.from_value.data)return[];for(e=this.from_value.data,i=[],t=0;t<e.length;t++)if(r=e[t])for(n=0;n<r.length;n++)i.push(r[n]);return i},clone:function(e,t,n){var i=this._getOptions();return i.from&&(i.from=i.from.clone(e,t,n)),i.to&&(i.to=i.to.clone(e,t,n)),new a(l.extend(i,{handler:this.handler},{sheet:e,row:t,col:n}))},exec:function(e,t,n,i){function r(t){return t instanceof kendo.spreadsheet.Ref&&(t=e.getData(t),Array.isArray(t)&&(t=t[0])),t}var o=this,s=function(e){o.from_value=r(e),o.value=o.handler.call(o,t,n),o._setMessages(),i&&i(o.value)};o.to?o.to.exec(e,function(t){o.to_value=r(t),o.from.exec(e,s)}):o.from.exec(e,s)},reset:function(){this.from&&this.from.reset(),this.to&&this.to.reset(),delete this.value},adjust:function(e,t,n,i){var r,o;if(this.from&&this.from.adjust(e,t,n,i),this.to&&this.to.adjust(e,t,n,i),this.sheet.toLowerCase()==e.toLowerCase())switch(r=this.row,o=this.col,t){case"row":r>=n&&(this.row+=i);break;case"col":o>=n&&(this.col+=i)}},toJSON:function(){var e=this._getOptions();return e.from&&(e.from=""+e.from,"list"===e.dataType&&(e.from=e.from.replace(/^_matrix\((.*)\)$/i,"$1"),delete e.fromIsListValue),"date"===e.dataType&&this.fromIsDateValue&&(e.from=e.from.replace(/^DATEVALUE\("(.*)"\)$/i,"$1"),delete e.fromIsDateValue)),e.to&&(e.to=""+e.to,"date"===e.dataType&&this.toIsDateValue&&(e.to=e.to.replace(/^DATEVALUE\("(.*)"\)$/i,"$1"),delete e.toIsDateValue)),e},_getOptions:function(){return{from:this.from,to:this.to,dataType:this.dataType,type:this.type,comparerType:this.comparerType,row:this.row,col:this.col,sheet:this.sheet,allowNulls:this.allowNulls,fromIsListValue:this.fromIsListValue,fromIsDateValue:this.fromIsDateValue,toIsDateValue:this.toIsDateValue,tooltipMessageTemplate:this.tooltipMessageTemplate,tooltipTitleTemplate:this.tooltipTitleTemplate,messageTemplate:this.messageTemplate,titleTemplate:this.titleTemplate,showButton:this.showButton}}}),n.compile=e,n.validationComparers={greaterThan:function(e,t){return e>t},lessThan:function(e,t){return e<t},between:function(e,t,n){return e>=t&&e<=n},equalTo:function(e,t){return e==t},notEqualTo:function(e,t){return e!=t},greaterThanOrEqualTo:function(e,t){return e>=t},lessThanOrEqualTo:function(e,t){return e<=t},notBetween:function(e,t,n){return e<t||e>n},custom:function(e,t){return t},list:function(e,t){return t.indexOf(e)>-1}},n.Validation=a)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheet.min",["kendo.core.min","kendo.color.min","spreadsheet/runtime.min","spreadsheet/validation.min","spreadsheet/references.min"],e)}(function(){!function(e){var t,n,i,r,o;e.support.browser.msie&&e.support.browser.version<9||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.spreadsheet.Range,r=e.Class.extend({init:function(t){this._sheet=t,this.selection=e.spreadsheet.FIRSTREF.toRangeRef(),this.originalSelection=e.spreadsheet.FIRSTREF.toRangeRef(),this._activeCell=e.spreadsheet.FIRSTREF.toRangeRef(),this.originalActiveCell=e.spreadsheet.FIRSTREF},currentSelectionRange:function(){return this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()},currentOriginalNavigationRange:function(){return this.originalSelection.rangeAt(this.selectionRangeIndex).toRangeRef()},currentNavigationRange:function(){return this.singleCellSelection()?this._sheet._sheetRef:this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()},nextNavigationRange:function(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.nextRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()},previousNavigationRange:function(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.previousRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()},activeCell:function(e){return e&&(this.originalActiveCell=e.first(),this._activeCell=this._sheet.unionWithMerged(e.toRangeRef()),this._sheet.focus(e),this._sheet.triggerChange({activeCell:!0,selection:!0})),this._activeCell},select:function(e,t,n){if(e){if(e.eq(this.originalSelection))return;this.originalSelection=e,this.selection=t,n!==!1?(this.activeCell(e.isCell()?e:this.selection.lastRange().first()),this.selectionRangeIndex=this.selection.size()-1):this._sheet.triggerChange({selection:!0})}return this.selection},singleCellSelection:function(){return this._activeCell.eq(this.selection)}}),o=e.Observable.extend({init:function(){e.Observable.prototype.init.call(this),this._reinit.apply(this,arguments)},_reinit:function(t,n,i,o,s,a){var l=t*n-1;this._rows=new e.spreadsheet.Axis(t,i),this._columns=new e.spreadsheet.Axis(n,o),this._mergedCells=[],this._frozenRows=0,this._frozenColumns=0,this._suspendChanges=!1,this._filter=null,this._showGridLines=!0,this._gridLinesColor=null,this._grid=new e.spreadsheet.Grid(this._rows,this._columns,t,n,s,a),this._sheetRef=this._grid.normalize(e.spreadsheet.SHEETREF),this._properties=new e.spreadsheet.PropertyBag(l),this._sorter=new e.spreadsheet.Sorter(this._grid,this._properties.sortable()),this._viewSelection=new r(this),this._editSelection=new r(this),this._formulaSelections=[]},_selectionState:function(){return this._inEdit?this._editSelection:this._viewSelection},navigator:function(){return this._navigator||(this._navigator=new e.spreadsheet.SheetNavigator(this)),this._navigator},axisManager:function(){return this._axisManager||(this._axisManager=new e.spreadsheet.AxisManager(this)),this._axisManager},_name:function(e){return e?(this._sheetName=e,this):this._sheetName},name:function(){return this._name()},_property:function(e,t,n){return void 0===t?e():(e(t),this.triggerChange(n))},_field:function(e,t,n){return void 0===t?this[e]:(this[e]=t,this.triggerChange(n))},suspendChanges:function(e){return void 0===e?this._suspendChanges:(this._suspendChanges=e,this)},triggerChange:function(e){return this._suspendChanges||this.trigger("change",e),this},setDataSource:function(t,n){this.dataSourceBinder&&this.dataSourceBinder.destroy(),this.dataSourceBinder=new e.spreadsheet.SheetDataSourceBinder({dataSource:t,sheet:this,columns:n}),this.dataSource=this.dataSourceBinder.dataSource},hideColumn:function(e){return this._property(this._columns.hide.bind(this._columns),e,{layout:!0})},unhideColumn:function(e){return this._property(this._columns.unhide.bind(this._columns),e,{layout:!0})},isHiddenColumn:function(e){return this._grid._columns.hidden(e)},_copyRange:function(e,t){var n=this._grid,i=n.rowCount,r=n.normalize(e.topLeft),o=n.normalize(e.bottomRight),s=r.col*i+r.row,a=o.col*i+o.row,l=t.col*i+t.row;this._properties.copy(s,a,l)},_adjustReferences:function(n,i,r,o){var s,a,l;this._mergedCells=o.reduce(function(e,o){return o=o.adjust(null,null,null,null,"row"==n,i,r),o instanceof t&&e.push(o),e},[]),this._workbook&&(s=this._name(),this._workbook._sheets.forEach(function(e){e._forFormulas(function(e){e.adjust(s,n,i,r)}),e._forValidations(function(e){e.adjust(s,n,i,r)})}),this._workbook.adjustNames(s,"row"==n,i,r)),a=this.select(),a=a.adjust(null,null,null,null,"row"==n,i,r),a!==e.spreadsheet.NULLREF&&this.select(a),l="col"==n?this._columns:this._rows,l.adjust(i,r)},_forFormulas:function(e){var t=this._properties,n=t.get("formula").values(),i=n.length;n.forEach(function(t,n){e.call(this,t.value,n,i)},this)},_forValidations:function(e){var t=this._properties;t.get("validation").values().forEach(function(t){e.call(this,t.value)},this)},canInsertRow:function(e,t){var n,i;return t=t||1,n=this._grid,i=this.range(n.rowCount-t,0,t,n.columnCount),!i.hasValue()},insertRow:function(e){if(!this.canInsertRow(e))throw Error("Shifting nonblank cells off the worksheet is not supported!");return this.batch(function(){var r,o,s,a,l,u,c=this._grid,h=c.columnCount,d=c.rowCount,f=this.frozenRows();for(e<f&&this.frozenRows(f+1),r=this._mergedCells.slice(),o=0;o<h;o++)s=new t(new n(e,o),new n(e,o)),a=c.normalize(s.topLeft),l=c.normalize(s.bottomRight),u=new t(new n(a.row,a.col),new n(d-2,l.col)),this._copyRange(u,new n(a.row+1,a.col)),new i(s,this).clear();this._adjustReferences("row",e,1,r)},{recalc:!0,layout:!0,insertRow:{index:e},ref:new t(new n(e,0),new n(1/0,1/0))}),this.trigger("insertRow",{index:e}),this},isEnabledRow:function(e){var r=new t(new n(e,0),new n(e,this._grid.columnCount));return new i(r,this).enable()},deleteRow:function(e){return this.isEnabledRow(e)?(this.batch(function(){var r,o,s,a,l,u,c,h=this._grid,d=h.columnCount,f=this.frozenRows();for(e<f&&this.frozenRows(f-1),r=this._mergedCells.slice(),o=0;o<d;o++)s=new t(new n(e,o),new n(e,o)),new i(s,this).clear(),a=h.normalize(s.topLeft),l=h.normalize(s.bottomRight),u=new t(new n(a.row+1,a.col),new n(1/0,l.col)),this._copyRange(u,a),c=h.normalize(u.bottomRight),new i(new t(c,c),this).clear();this._adjustReferences("row",e,-1,r)},{recalc:!0,layout:!0,deleteRow:{index:e},ref:new t(new n(e,0),new n(1/0,1/0))}),this.trigger("deleteRow",{index:e}),this):this},insertColumn:function(e){return this.batch(function(){var r,o,s,a,l,u,c=this._grid,h=c.columnCount,d=this.frozenColumns();for(e<d&&this.frozenColumns(d+1),r=this._mergedCells.slice(),o=h;o>=e&&(s=new t(new n(0,o),new n(1/0,o)),new i(s,this).clear(),o!=e);o--)a=c.normalize(s.topLeft),l=c.normalize(s.bottomRight),u=new t(new n(a.row,a.col-1),new n(l.row,l.col-1)),this._copyRange(u,a);this._adjustReferences("col",e,1,r)},{recalc:!0,layout:!0,insertColumn:{index:e},ref:new t(new n(0,e),new n(1/0,1/0))}),this},isEnabledColumn:function(e){var r=new t(new n(0,e),new n(1/0,e));return new i(r,this).enable()},deleteColumn:function(e){return this.isEnabledColumn(e)?(this.batch(function(){var r,o,s,a,l,u,c=this._grid,h=c.columnCount,d=this.frozenColumns();for(e<d&&this.frozenColumns(d-1),r=this._mergedCells.slice(),o=e;o<h&&(s=new t(new n(0,o),new n(1/0,o)),new i(s,this).clear(),o!=h-1);o++)a=c.normalize(s.topLeft),l=c.normalize(s.bottomRight),u=new t(new n(a.row,a.col+1),new n(l.row,l.col+1)),this._copyRange(u,a);this._adjustReferences("col",e,-1,r)},{recalc:!0,layout:!0,deleteColumn:{index:e},ref:new t(new n(0,e),new n(1/0,1/0))}),this):this},hideRow:function(e){return this._property(this._rows.hide.bind(this._rows),e,{layout:!0})},unhideRow:function(e){return this._property(this._rows.unhide.bind(this._rows),e,{layout:!0})},isHiddenRow:function(e){return this._grid._rows.hidden(e)},columnWidth:function(e,t){return this._property(this._columns.value.bind(this._columns,e,e),t,{layout:!0})},rowHeight:function(e,t){return this._property(this._rows.value.bind(this._rows,e,e),t,{layout:!0})},frozenRows:function(e){return this._field("_frozenRows",e,{layout:!0})},frozenColumns:function(e){return this._field("_frozenColumns",e,{layout:!0})},showGridLines:function(e){return this._field("_showGridLines",e,{layout:!0})},gridLinesColor:function(e){return this._field("_gridLinesColor",e,{layout:!0})},_ref:function(i,r,o,s){var a=null;return i instanceof e.spreadsheet.Ref?i:i instanceof e.spreadsheet.Range?i._ref.toRangeRef():("string"==typeof i?a=e.spreadsheet.calc.parseReference(i):(o||(o=1),s||(s=1),a=new t(new n(i,r),new n(i+o-1,r+s-1))),a)},range:function(e,t,n,r){return new i(this._ref(e,t,n,r),this)},forEachMergedCell:function(e,t){var n=!1;void 0===t&&(t=e,n=!0),this._mergedCells.forEach(function(i){(n||i.intersects(e))&&t(i)})},forEachFilterHeader:function(e,t){var n,i=!1;void 0===t&&(t=e,i=!0),this._filter&&(n=[],this._filter.ref.forEachColumn(function(t){(i||t.intersects(e))&&n.push(t.topLeft)}),this._mergedCells.forEach(function(e){n=n.map(function(t){return e.intersects(t)?e:t})}),n.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[]).forEach(t))},forEach:function(e,n){var i,r,o,s,a,l;for(e instanceof t||(e=this._ref(e)),i=this._grid.normalize(e.topLeft),r=this._grid.normalize(e.bottomRight),o=i.col;o<=r.col;o++)s=i.row,a=this._grid.index(s,o),l=this._grid.index(r.row,o),this._properties.forEach(a,l,function(e){n(s++,o,e)})},startResizing:function(e){this._initialPosition=e,this._resizeInProgress=!0},startAutoFill:function(){this._autoFillInProgress=!0;var e=this.select();this._autoFillOrigin=e,this._autoFillDest=e,this.triggerChange({selection:!0})},updateAutoFill:function(e,t,n,i){this._autoFillDest=e,this._autoFillPunch=t,this._autoFillHint=n,this._autoFillDirection=i,this.triggerChange({selection:!0})},autoFillRef:function(){return this._autoFillDest},autoFillPunch:function(){return this._autoFillPunch},autoFillInProgress:function(){return this._autoFillInProgress},resizingInProgress:function(){return this._resizeInProgress},completeResizing:function(){var e,t;this._resizeInProgress&&(this._resizeInProgress=!1,e=this.resizeHintPosition(),this._initialPosition&&e?(t=this.resizeHandlePosition(),t.col!==-(1/0)?this.trigger("commandRequest",{command:"ColumnWidthCommand",options:{target:t.col,value:this.columnWidth(t.col)-(this._initialPosition.x-e.x)}}):this.trigger("commandRequest",{command:"RowHeightCommand",options:{target:t.row,value:this.rowHeight(t.row)-(this._initialPosition.y-e.y)}})):this.trigger("change",{resize:!0}))},resizeHandlePosition:function(){return this._resizeHandlePosition},resizeHintPosition:function(e){return void 0!==e&&(this._resizeHintPosition=e,this.trigger("change",{resize:!0})),this._resizeHintPosition},removeResizeHandle:function(){this._resizeHandlePosition&&(this._resizeHintPosition=void 0,this._resizeHandlePosition=void 0,this._initialPosition=void 0,this.trigger("change",{resize:!0}))},positionResizeHandle:function(e){this._resizeHandlePosition=e,this.trigger("change",{resize:!0})},startSelection:function(){this._selectionInProgress=!0},completeSelection:function(){var e,t;this._selectionInProgress&&(this._selectionInProgress=!1,this._resizeHintPosition=void 0,this.trigger("change",{selection:!0})),this._autoFillInProgress&&(this._autoFillInProgress=!1,
e=this._autoFillDest,t=this._autoFillOrigin,this._autoFillPunch?this.trigger("commandRequest",{command:"ClearContentCommand",options:{operatingRange:this.range(this._autoFillPunch)}}):e.eq(t)?this.triggerChange({selection:!0}):this.trigger("commandRequest",{command:"AutoFillCommand",options:{operatingRange:this.range(e),origin:this.range(t)}}),this._autoFillDest=null,this._autoFillPunch=null,this._autoFillOrigin=null,this.select(e))},selectionInProgress:function(){return this._selectionInProgress},select:function(e,t){var n,i=this._selectionState();return e&&(e=this._ref(e),e=this._grid.normalize(e),n=this._grid.isAxis(e)?e:this.unionWithMerged(e)),i.select(e,n,t)},originalSelect:function(){return this._selectionState().originalSelection},currentSelectionRange:function(){return this._selectionState().currentSelectionRange()},currentOriginalSelectionRange:function(){return this._selectionState().currentOriginalNavigationRange()},currentNavigationRange:function(){return this._selectionState().currentNavigationRange()},nextNavigationRange:function(){return this._selectionState().nextNavigationRange()},previousNavigationRange:function(){return this._selectionState().previousNavigationRange()},selectionRangeIndex:function(){return this._selectionState().selectionRangeIndex},activeCell:function(e){return this._selectionState().activeCell(e)},originalActiveCell:function(){return this._selectionState().originalActiveCell},singleCellSelection:function(){return this._selectionState().singleCellSelection()},unionWithMerged:function(e){var t=this._mergedCells;return e.map(function(e){return e.toRangeRef().union(t)})},trim:function(e){var t=[],n=this._grid;return this._properties.forEachProperty(function(i){t.push(n.trim(e,i.list))}),this.unionWithMerged(e.topLeft.toRangeRef().union(t))},focus:function(e){if(!e){var t=this._focus;return this._focus=null,t}this._focus=e.toRangeRef()},activeCellSelection:function(){return new i(this._grid.normalize(this.activeCell()),this)},selection:function(){return new i(this._grid.normalize(this._selectionState().selection),this)},selectedHeaders:function(){var e=this.select(),t={},n={},i=!1,r=!1,o=this._grid.rowCount-1,s=this._grid.columnCount-1;return e.forEach(function(e){var a,l,u,c,h="partial",d="partial";if(e=e.toRangeRef(),l=e.bottomRight,u=l.col>=s,c=l.row>=o,c&&(r=!0,d="full"),u&&(i=!0,h="full"),!c)for(a=e.topLeft.row;a<=l.row;a++)"full"!==t[a]&&(t[a]=h);if(!u)for(a=e.topLeft.col;a<=l.col;a++)"full"!==n[a]&&(n[a]=d)}),{rows:t,cols:n,allRows:r,allCols:i,all:r&&i}},isInEditMode:function(e){return void 0===e?this._inEdit:(this._inEdit=e,void(e&&(this._editSelection.selection=this._viewSelection.selection.clone(),this._editSelection.originalSelection=this._viewSelection.originalSelection.clone(),this._editSelection._activeCell=this._viewSelection._activeCell.clone(),this._editSelection.originalActiveCell=this._viewSelection.originalActiveCell.clone())))},_setFormulaSelections:function(e){this._formulaSelections=(e||[]).slice(),this.triggerChange({selection:!0})},_viewActiveCell:function(){return this._viewSelection._activeCell.toRangeRef()},toJSON:function(){var t,n={},i=this._rows.toJSON("height",n),r=this._columns.toJSON("width",{}),o=this._viewSelection,s=[];return this.forEach(e.spreadsheet.SHEETREF,function(t,r,o){if(0!==Object.keys(o).length){o.link&&s.push({ref:e.spreadsheet.Ref.display(null,t,r),target:o.link});var a=n[t];void 0===a&&(a=i.length,i.push({index:t}),n[t]=a),t=i[a],o.index=r,void 0===t.cells&&(t.cells=[]),o.formula&&(o.formula=""+o.formula),o.validation&&(o.validation=o.validation.toJSON()),o.color&&(o.color=e.parseColor(o.color).toCss()),o.background&&(o.background=e.parseColor(o.background).toCss()),o.borderTop&&o.borderTop.color&&(o.borderTop.color=e.parseColor(o.borderTop.color).toCss()),o.borderBottom&&o.borderBottom.color&&(o.borderBottom.color=e.parseColor(o.borderBottom.color).toCss()),o.borderRight&&o.borderRight.color&&(o.borderRight.color=e.parseColor(o.borderRight.color).toCss()),o.borderLeft&&o.borderLeft.color&&(o.borderLeft.color=e.parseColor(o.borderLeft.color).toCss()),t.cells.push(o)}}),t={name:this._name(),rows:i,columns:r,selection:""+o.selection,activeCell:""+o.activeCell(),frozenRows:this.frozenRows(),frozenColumns:this.frozenColumns(),showGridLines:this.showGridLines(),gridLinesColor:this.gridLinesColor(),mergedCells:this._mergedCells.map(function(e){return""+e}),hyperlinks:s},this._sort&&(t.sort={ref:""+this._sort.ref,columns:this._sort.columns.map(function(e){return{index:e.index,ascending:e.ascending}})}),this._filter&&(t.filter={ref:""+this._filter.ref,columns:this._filter.columns.map(function(e){var t=e.filter.toJSON();return t.index=e.index,t})}),t},fromJSON:function(t){this.batch(function(){var n,i,r,o,s,a,l,u,c;if(void 0!==t.name&&this._name(t.name),void 0!==t.frozenColumns&&this.frozenColumns(t.frozenColumns),void 0!==t.frozenRows&&this.frozenRows(t.frozenRows),void 0!==t.columns&&this._columns.fromJSON("width",t.columns),void 0!==t.rows)for(this._rows.fromJSON("height",t.rows),n=0;n<t.rows.length;n++)if(i=t.rows[n],r=i.index,void 0===r&&(r=n),i.cells)for(o=0;o<i.cells.length;o++)s=i.cells[o],a=s.index,void 0===a&&(a=o),s.formula&&(s.formula=this._compileFormula(r,a,s.formula)),s.validation&&(s.validation=this._compileValidation(r,a,s.validation)),this._properties.fromJSON(this._grid.index(r,a),s);t.selection&&(this._viewSelection.selection=this._viewSelection.originalSelection=this._ref(t.selection)),t.activeCell&&(l=this._ref(t.activeCell),this._viewSelection._activeCell=l.toRangeRef(),this._viewSelection.originalActiveCell=l),t.mergedCells&&t.mergedCells.forEach(function(e){this.range(e).merge()},this),t.sort&&(this._sort={ref:this._ref(t.sort.ref),columns:t.sort.columns.slice(0)}),t.filter&&(u=t.filter.ref,c=void 0===t.filter.columns?[]:t.filter.columns,u?(this._filter={ref:this._ref(u),columns:c.map(function(t){return{index:t.index,filter:e.spreadsheet.Filter.create(t)}})},this._refreshFilter()):e.logToConsole("Dropping filter for sheet '"+t.name+"' due to missing ref")),void 0!==t.showGridLines&&(this._showGridLines=t.showGridLines),this._gridLinesColor=t.gridLinesColor}),this._rows._refresh(),this._columns._refresh()},formula:function(e){return this._properties.get("formula",this._grid.cellRefIndex(e))},validation:function(e){return this._properties.get("validation",this._grid.cellRefIndex(e))},resetFormulas:function(){this._forFormulas(function(e){e.reset()})},resetValidations:function(){this._forValidations(function(e){e.reset()})},recalc:function(e,t){function n(){o--,s!=r||o||t()}var i=this._properties.get("formula").values(),r=i.length,o=0,s=0;if(!r&&t)return t();for(;s<r;)o++,i[s++].value.exec(e,t?n:null)},revalidate:function(e){var i=this;this._forValidations(function(r){var o=new n(r.row,r.col),s=new t(o,o);r.exec(e,i._get(s,"value"),i._get(s,"format"))})},_value:function(e,t,n){var i=this._grid.index(e,t);return void 0===n?this._properties.get("value",i):void this._properties.set("value",i,i,n)},_validation:function(e,t){var n=this._grid.index(e,t);return this._properties.get("validation",n)},_compileValidation:function(t,n,i){return i instanceof e.spreadsheet.validation.Validation?i.clone(this._name(),t,n):(null!=i.from&&(i.from=(i.from+"").replace(/^=/,"")),null!=i.to&&(i.to=(i.to+"").replace(/^=/,"")),e.spreadsheet.validation.compile(this._name(),t,n,i))},_compileFormula:function(t,n,i){return i=i.replace(/^=/,""),i=e.spreadsheet.calc.parseFormula(this._name(),t,n,i),e.spreadsheet.calc.compile(i)},_copyValuesInRange:function(e,t,n,i){var r,o,s,a,l;for(r=e.col;r<=t.col;r++)for(o=this._grid.index(e.row,r),s=this._grid.index(t.row,r),a=o,l=e.row;a<=s;++a,++l)n=n.clone(this._name(),l,r),this._properties.set(i,a,a,n);return n},_set:function(e,t,n){var i,r,o,s=this._grid.normalize(e.topLeft),a=this._grid.normalize(e.bottomRight);if(n&&"formula"==t)"string"==typeof n&&(n=this._compileFormula(s.row,s.col,n)),n=this._copyValuesInRange(s,a,n,"formula");else if(n&&"validation"==t)n=this._compileValidation(s.row,s.col,n),n=this._copyValuesInRange(s,a,n,"validation");else for(i=s.col;i<=a.col;i++)r=this._grid.index(s.row,i),o=this._grid.index(a.row,i),this._properties.set(t,r,o,n),"formula"==t&&this._properties.set("value",r,o,null)},_get:function(e,t){var n=this._grid.normalize(e.topLeft),i=this._grid.index(n.row,n.col);return this._properties.get(t,i)},batch:function(e,t){var n=this.suspendChanges();return this.suspendChanges(!0),e.call(this),this.suspendChanges(n).triggerChange(t||{recalc:!0})},_sortBy:function(e,t){var n=null;t.forEach(function(t){n=this._sorter.sortBy(e,t.index,this._properties.get("value"),t.ascending,n)},this),this._sort={ref:e,columns:t},this._refreshFilter(),this.triggerChange({recalc:!0})},_refreshFilter:function(){this._filter&&this._filterBy(this._filter.ref,this._filter.columns)},_filterBy:function(t,n){this.batch(function(){for(var i=t.topLeft.row;i<=t.bottomRight.row;i++)this._rows.hidden(i)&&this._rows.unhide(i);n.forEach(function(n){var i,r,o,s=t.resize({top:1}).toColumn(n.index),a=[];if(s!==e.spreadsheet.NULLREF)for(this.forEach(s,function(e,t,n){n.row=e,a.push(n)}),n.filter.prepare(a),i=0;i<a.length;i++)r=a[i],o=n.filter.value(r),n.filter.matches(o)===!1&&this.hideRow(r.row)},this),this._filter={ref:t,columns:n}},{layout:!0,filter:!0})},filterColumn:function(e){var t=this.filter().ref;return e.toRangeRef().topLeft.col-t.topLeft.col},filter:function(){return this._filter},clearFilter:function(e){this._clearFilter(e instanceof Array?e:[e])},_clearFilter:function(e){this._filter&&this.batch(function(){this._filter.columns=this._filter.columns.filter(function(t){return e.indexOf(t.index)<0}),this._refreshFilter()},{layout:!0,filter:!0})},getAxisState:function(){return{rows:this._rows.getState(),columns:this._columns.getState()}},setAxisState:function(e){this._rows.setState(e.rows),this._columns.setState(e.columns),this.triggerChange({layout:!0})},getState:function(){return{rows:this._rows.getState(),columns:this._columns.getState(),mergedCells:this._mergedCells.map(function(e){return e.clone()}),properties:this._properties.getState()}},setState:function(t){this._rows.setState(t.rows),this._columns.setState(t.columns),this._mergedCells=t.mergedCells,this._properties.setState(t.properties),this.triggerChange(e.spreadsheet.ALL_REASONS)},_merge:function(t){var n,r=this._mergedCells,o=this;return this.batch(function(){n=t.map(function(t){var n,s,a,l,u,c,h;return t instanceof e.spreadsheet.CellRef?t:(n=t.toRangeRef().union(r,function(e){r.splice(r.indexOf(e),1)}),s=new i(n,o),a=s._get("formula"),l=s.value(),u=s.format(),c=s.background(),s.value(null),s.format(null),s.background(null),h=new i(n.collapse(),o),a?h._set("formula",a):h.value(l),h.format(u),h.background(c),r.push(n),n)});var s=o._viewSelection;s.selection=o.unionWithMerged(s.originalSelection),s._activeCell=o.unionWithMerged(s.originalActiveCell)},{activeCell:!0,selection:!0}),n}}),e.spreadsheet.Sheet=o)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheetsbar.min",["kendo.core.min","kendo.sortable.min"],e)}(function(){!function(e){var t,n,i,r,o,s;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n=e._outerWidth,i=".",r=" ",o={sheetsBarWrapper:"k-widget k-header",sheetsBarSheetsWrapper:"k-tabstrip k-floatwrap k-tabstrip-bottom",sheetsBarActive:"k-spreadsheet-sheets-bar-active",sheetsBarInactive:"k-spreadsheet-sheets-bar-inactive",sheetsBarAdd:"k-spreadsheet-sheets-bar-add",sheetsBarRemove:"k-spreadsheet-sheets-remove",sheetsBarItems:"k-spreadsheet-sheets-items",sheetsBarEditor:"k-spreadsheet-sheets-editor",sheetsBarScrollable:"k-tabstrip-scrollable",sheetsBarNext:"k-tabstrip-next",sheetsBarPrev:"k-tabstrip-prev",sheetsBarKItem:"k-item k-state-default",sheetsBarKActive:"k-state-active k-state-tab-on-top",sheetsBarKTextbox:"k-textbox",sheetsBarKLink:"k-link",sheetsBarKIcon:"k-icon",sheetsBarKFontIcon:"k-font-icon",sheetsBarKButton:"k-button k-button-icon",sheetsBarKButtonBare:"k-button-bare",sheetsBarKArrowW:"k-i-arrow-w",sheetsBarKArrowE:"k-i-arrow-e",sheetsBarKReset:"k-reset k-tabstrip-items",sheetsBarKIconX:"k-i-x",sheetsBarKSprite:"k-sprite",sheetsBarKIconPlus:"k-i-plus",sheetsBarHintWrapper:"k-widget k-tabstrip k-tabstrip-bottom k-spreadsheet-sheets-items-hint",sheetsBarKResetItems:"k-reset k-tabstrip-items"},s=e.ui.Widget.extend({init:function(t,n){var r=s.classNames;e.ui.Widget.call(this,t,n),t=this.element,t.addClass(r.sheetsBarWrapper),this._tree=new e.dom.Tree(t[0]),this._tree.render([this._addButton(),this._createSheetsWrapper([])]),this._toggleScrollEvents(!0),this._createSortable(),this._sortable.bind("start",this._onSheetReorderStart.bind(this)),this._sortable.bind("end",this._onSheetReorderEnd.bind(this)),t.on("click",i+r.sheetsBarRemove,this._onSheetRemove.bind(this)),t.on("click","li",this._onSheetSelect.bind(this)),t.on("dblclick","li"+i+r.sheetsBarActive,this._createEditor.bind(this)),t.on("click",i+r.sheetsBarAdd,this._onAddSelect.bind(this))},options:{name:"SheetsBar",scrollable:{distance:200}},events:["select","reorder","rename"],_createEditor:function(){this._editor||(this._renderSheets(this._sheets,this._selectedIndex,!0),this._editor=this.element.find(e.format("input{0}{1}",i,s.classNames.sheetsBarEditor)).focus().on("keydown",this._onEditorKeydown.bind(this)).on("blur",this._onEditorBlur.bind(this)))},_destroyEditor:function(e){var t=e?null:this._editor.val();this._editor.off(),this._editor=null,this._renderSheets(this._sheets,this._selectedIndex,!1),this._onSheetRename(t)},renderSheets:function(e,t){!e||t<0||this._renderSheets(e,t,!1)},_renderSheets:function(t,o,a){var l,u,c,h,d,f,p,m,g,v,b,w=this,y=s.classNames;w._isRtl=e.support.isRtl(w.element),w._sheets=t,w._selectedIndex=o,w._renderHtml(a,!0),w._scrollableAllowed()&&(c=w._sheetsWrapper(),h=c.children(i+y.sheetsBarPrev),d=c.children(i+y.sheetsBarNext),f=2,p=w.element.find(i+y.sheetsBarAdd),m=n(p)+p.position().left+f,g=n(h)+f,v=w._sheetsGroup(),h.css({left:m}),c.addClass(y.sheetsBarScrollable+r+y.sheetsBarSheetsWrapper),v.css({marginLeft:m}),l=c[0].offsetWidth,u=v[0].scrollWidth,u+m>l?(b=Math.ceil(e.parseFloat(d.css("right"))),w._scrollableModeActive||(w._nowScrollingSheets=!1,w._scrollableModeActive=!0),v.css({marginLeft:g+m,marginRight:n(d)+b+f})):w._scrollableModeActive&&u<=l?(w._scrollableModeActive=!1,v.css({marginLeft:m,marginRight:""})):v.css({marginLeft:m}),w._toggleScrollButtons())},_toggleScrollButtons:function(e){var t=this,n=t._sheetsGroup(),r=t._sheetsWrapper(),o=n.scrollLeft(),a=r.find(i+s.classNames.sheetsBarPrev),l=r.find(i+s.classNames.sheetsBarNext);e===!1?(a.toggle(!1),l.toggle(!1)):(a.toggle(t._isRtl?o<n[0].scrollWidth-n[0].offsetWidth-1:0!==o),l.toggle(t._isRtl?0!==o:o<n[0].scrollWidth-n[0].offsetWidth-1))},_toggleScrollEvents:function(e){var t=this,n=s.classNames,r=t.options,o=t._sheetsWrapper(),a=o.children(i+n.sheetsBarPrev),l=o.children(i+n.sheetsBarNext);e?(a.on("mousedown",function(){t._nowScrollingSheets=!0,t._scrollSheetsByDelta(r.scrollable.distance*(t._isRtl?1:-1))}),l.on("mousedown",function(){t._nowScrollingSheets=!0,t._scrollSheetsByDelta(r.scrollable.distance*(t._isRtl?-1:1))}),a.add(l).on("mouseup",function(){t._nowScrollingSheets=!1})):(a.off(),l.off())},_renderHtml:function(t,n){var i,o,a,l,u,c,h=[],d=e.dom,f=d.element,p=this._sheets,m=this._selectedIndex,g=s.classNames;for(i=0;i<p.length;i++)o=p[i],a=i===m,l={className:g.sheetsBarKItem+r},u=[],l.className+=a?g.sheetsBarKActive+r+g.sheetsBarActive:g.sheetsBarInactive,a&&t?u.push(f("input",{type:"text",value:o.name(),className:g.sheetsBarKTextbox+r+g.sheetsBarEditor,maxlength:50},[])):(u.push(f("span",{className:g.sheetsBarKLink,title:o.name()},[d.text(o.name())])),c=f("span",{className:g.sheetsBarKIcon+r+g.sheetsBarKFontIcon+r+g.sheetsBarKIconX},[]),u.push(f("span",{className:g.sheetsBarKLink+r+g.sheetsBarRemove},[c]))),h.push(f("li",l,u));this._tree.render([this._addButton(),this._createSheetsWrapper(h,n)])},_createSheetsWrapper:function(t,n){var i,o=e.dom.element,a=s.classNames,l=[o("ul",{className:a.sheetsBarKReset},t)];return n=!0,n&&(i=a.sheetsBarKButton+r+a.sheetsBarKButtonBare+r,l.push(o("span",{className:i+a.sheetsBarPrev},[o("span",{className:a.sheetsBarKIcon+r+a.sheetsBarKArrowW},[])])),l.push(o("span",{className:i+a.sheetsBarNext},[o("span",{className:a.sheetsBarKIcon+r+a.sheetsBarKArrowE},[])]))),o("div",{className:a.sheetsBarItems},l)},_createSortable:function(){var n=s.classNames;this._sortable=new e.ui.Sortable(this.element,{filter:e.format("ul li.{0},ul li.{1}",n.sheetsBarActive,n.sheetsBarInactive),container:i+n.sheetsBarItems,axis:"x",animation:!1,ignore:"input",end:function(){this.draggable.hint&&this.draggable.hint.remove()},hint:function(e){var i=t(e).clone();return i.wrap("<div class='"+n.sheetsBarHintWrapper+"'><ul class='"+n.sheetsBarKResetItems+"'></ul></div>").closest("div")}})},_onEditorKeydown:function(e){this._editor&&(13===e.which&&this._destroyEditor(),27===e.which&&this._destroyEditor(!0))},_onEditorBlur:function(){this._editor&&this._destroyEditor()},_onSheetReorderEnd:function(e){e.preventDefault(),this.trigger("reorder",{oldIndex:e.oldIndex,newIndex:e.newIndex})},_onSheetReorderStart:function(e){this._editor&&e.preventDefault()},_onSheetRemove:function(e){var n=t(e.target).closest("li").text();this._editor&&this._destroyEditor(),this.trigger("remove",{name:n})},_onSheetSelect:function(e){var n=t(e.target).text();return t(e.target).is(i+s.classNames.sheetsBarEditor)||!n?void e.preventDefault():(this._editor&&this._destroyEditor(),this._scrollSheetsToItem(t(e.target).closest("li")),void this.trigger("select",{name:n,isAddButton:!1}))},_onSheetRename:function(e){this.trigger("rename",{name:e,sheetIndex:this._selectedIndex})},_onAddSelect:function(){this.trigger("select",{isAddButton:!0})},_addButton:function(){var t=e.dom.element,n=s.classNames;return t("a",{className:n.sheetsBarAdd+r+n.sheetsBarKButton},[t("span",{className:n.sheetsBarKSprite+r+n.sheetsBarKIcon+r+n.sheetsBarKFontIcon+r+n.sheetsBarKIconPlus},[])])},destroy:function(){this._sortable.destroy()},_scrollableAllowed:function(){var e=this.options;return e.scrollable&&!isNaN(e.scrollable.distance)},_scrollSheetsToItem:function(e){var t,i,r,o,s,a,l,u=this;u._scrollableModeActive&&(t=u._sheetsGroup(),i=t.scrollLeft(),r=n(e),o=u._isRtl?e.position().left:e.position().left-t.children().first().position().left,s=t[0].offsetWidth,a=Math.ceil(parseFloat(t.css("padding-left"))),u._isRtl?o<0?l=i+o-(s-i)-a:o+r>s&&(l=i+o-r+2*a):i+s<o+r?l=o+r-s+2*a:i>o&&(l=o-a),t.finish().animate({scrollLeft:l},"fast","linear",function(){u._toggleScrollButtons()}))},_sheetsGroup:function(){return this._sheetsWrapper().children("ul")},_sheetsWrapper:function(){return this.element.find(i+s.classNames.sheetsBarItems)},_scrollSheetsByDelta:function(e){var t=this,n=t._sheetsGroup(),i=n.scrollLeft();n.finish().animate({scrollLeft:i+e},"fast","linear",function(){t._nowScrollingSheets?t._scrollSheetsByDelta(e):t._toggleScrollButtons()})}}),e.spreadsheet.SheetsBar=s,t.extend(!0,s,{classNames:o}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/calc.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e){e=e.toUpperCase();for(var t=0,n=0;n<e.length;++n)t=26*t+e.charCodeAt(n)-64;return t-1}function t(e){return parseInt(e,10)-1}function n(n,i){var r,o,s,a,l,c;if("#sheet"==n.toLowerCase())return g.SHEETREF;e:{if(!(r=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(n))){for(a=u(n,{}),l=[];;){if(c=a.next(),c instanceof w)c.rel=0;else{if(!(c instanceof b))break e;c.topLeft.rel=0,c.bottomRight.rel=0}if(l.push(c),a.eof())break;if(!a.is("op",","))break e;a.next()}return 1==l.length?l[0]:new g.UnionRef(l)}if(o=t(r[4]),s=e(r[2]),o<1048576&&s<16384)return new w(t(r[4]),e(r[2]))}if(!i)throw Error("Cannot parse reference: "+n)}function i(e,t,n,i){function r(e){return e.index=v.length,v.push(e),e}function o(e,t,n){if(g(e,t))return i.next();var r=i.peek();r?i.croak("Expected "+e+" «"+t+"» but found "+r.type+" «"+r.value+"»"):n||i.croak("Expected "+e+" «"+t+"»")}function s(e){return m(f(h(e)),0,e)}function a(e){return"TRUE"==e.upper||"FALSE"==e.upper?"TRUE"==e.upper?F:R:r(new y(e.value))}function l(){var e,t=i.next();for(t=t.value,o("punc","("),e=[];;){if(g("punc",")"))break;if(g("op",","))e.push({type:"null"}),i.next();else{if(e.push(s(!1)),i.eof()||g("punc",")"))break;o("op",",")}}return o("punc",")",!0),{type:"func",func:t,args:e}}function c(t){return t.hasSheet()||t.setSheet(e),r(t)}function h(e){var t;return g("ref")?t=c(i.next()):g("func")?t=l():g("punc","(")?(i.next(),t=s(!0),o("punc",")",!0)):g("punc","{")?(i.next(),t=d(),o("punc","}",!0)):g("num")||g("str")||g("error")?t=i.next():g("sym")?t=a(i.next()):g("op","+")||g("op","-")?t={type:"prefix",op:i.next().value,exp:h(e)}:i.croak(i.peek()?"Parse error":"Incomplete expression"),p(t)}function d(){for(var e=[],t=[e],n=!0;!i.eof()&&!g("punc","}");)n?n=!1:g("punc",";")?(t.push(e=[]),i.next()):o("op",","),e.push(s(!1));return{type:"matrix",value:t}}function f(e){return g("punc","(")||g("ref")||g("num")||g("func")?{type:"binary",op:" ",left:e,right:s(!1)}:e}function p(e){return g("op","%")?(i.next(),p({type:"postfix",op:"%",exp:e})):e}function m(e,t,n){var r,o,s=g("op");return s&&(n||","!=s.value)&&(r=x[s.value],r>t)?(i.next(),o=m(h(n),r,n),m({type:"binary",op:s.value,left:e,right:o},t,n)):e}var g,v=[];return i=u(i,{row:t,col:n}),g=i.is,{type:"exp",ast:s(!0),refs:v,sheet:e,row:t,col:n}}function r(e,t){var n,r=i(null,0,0,e);if(!(r.ast instanceof y))throw new C("Invalid name: "+e);return r=r.ast,t instanceof v||(n=i(r.sheet,0,0,t),t=n.ast instanceof v?n.ast:/^(?:str|num|bool|error)$/.test(n.ast.type)?n.ast.value:a(n)),{name:r,value:t}}function o(e){function t(e,i,r){function o(t){var o=e.op,s=x[o]<r||!r&&","==o||"binary"==i.type&&r==x[o]&&e===i.right;return n(t(),s)}switch(e.type){case"num":case"bool":return JSON.stringify(e.value);case"error":return JSON.stringify("#"+e.value);case"str":return JSON.stringify(JSON.stringify(e.value));case"ref":return"this.refs["+e.index+"].print(row, col, mod)";case"prefix":return o(function(){return JSON.stringify(e.op)+" + "+t(e.exp,e,x[e.op])});case"postfix":return o(function(){return t(e.exp,e,x[e.op])+" + "+JSON.stringify(e.op)});case"binary":return o(function(){var i=n(t(e.left,e,x[e.op]),e.left instanceof y&&":"==e.op),r=n(t(e.right,e,x[e.op]),e.right instanceof y&&":"==e.op);return i+" + "+JSON.stringify(e.op)+" + "+r});case"func":return JSON.stringify(e.func+"(")+" + "+(e.args.length>0?e.args.map(function(n){return t(n,e,0)}).join(" + ', ' + "):"''")+" + ')'";case"matrix":return"'{ ' + "+e.value.map(function(n){return n.map(function(n){return t(n,e,0)}).join(" + ', ' + ")}).join(" + '; ' + ")+"+ ' }'";case"null":return"''"}throw Error("Cannot make printer for node "+e.type)}function n(e,t){return t?"'(' + "+e+" + ')'":e}return S("function(row, col, mod){return("+t(e.ast,e,0)+")}")}function s(e,t){function n(e,t){switch(e.type){case"ref":return i(e,t);case"num":case"str":case"null":case"error":case"bool":return r(e,t);case"prefix":case"postfix":return s(e,t);case"binary":return a(e,t);case"func":return h(e,t);case"lambda":return d(e,t);case"matrix":return f(e.value,t,!0)}throw Error("Cannot CPS "+e.type)}function i(e,t){return"name"==e.ref?o(e,t):r(e,t)}function r(e,t){return t(e)}function o(e,t){return{type:"func",func:",getname",args:[p(t),e]}}function s(e,t){return n({type:"func",func:"unary"+e.op,args:[e.exp]},t)}function a(e,t){return n({type:"func",func:"binary"+e.op,args:[e.left,e.right]},t)}function l(e,t,i,r){return n(e,function(e){var o=p(r),s=m("T"),a=m("E");return{type:"func",func:"if",args:[o,e,{type:"lambda",vars:[s],body:n(t||F,function(e){return{type:"call",func:{type:"var",name:s},args:[e]}})},{type:"lambda",vars:[a],body:n(i||R,function(e){return{type:"call",func:{type:"var",name:a},args:[e]}})}]}})}function u(e,t){return 0===e.length?r(F,t):n({type:"func",func:"IF",args:[e[0],{type:"func",func:"AND",args:e.slice(1)},R]},t)}function c(e,t){return 0===e.length?r(R,t):n({type:"func",func:"IF",args:[e[0],F,{type:"func",func:"OR",args:e.slice(1)}]},t)}function h(e,t){switch(e.func.toLowerCase()){case"if":return l(e.args[0],e.args[1],e.args[2],t);case"and":return u(e.args,t);case"or":return c(e.args,t);case"true":return t(F);case"false":return t(R)}return function i(t,r){return r==e.args.length?{type:"func",func:e.func,args:t}:n(e.args[r],function(e){return i(t.concat([e]),r+1)})}([p(t)],0)}function d(e,t){var i=m("K"),r=n(e.body,function(e){return{type:"call",func:{type:"var",value:i},args:[e]}});return t({type:"lambda",vars:[i].concat(e.vars),body:r})}function f(e,t,i){var r=[];return function o(s){return s==e.length?t({type:"matrix",value:r}):(i?f:n)(e[s],function(e){return r[s]=e,o(s+1)})}(0)}function p(e){var t=m("R");return{type:"lambda",vars:[t],body:e({type:"var",name:t})}}function m(e){return e||(e=""),e="_"+e,e+ ++g}var g=0;return n(e,t)}function a(e){function t(e){var i=e.type;if("num"==i)return e.value+"";if("str"==i)return JSON.stringify(e.value);if("error"==i)return"context.error("+JSON.stringify(e.value)+")";if("return"==i)return"context.resolve("+t(e.value)+")";if("func"==i)return"context.func("+JSON.stringify(e.func)+", "+t(e.args[0])+", "+n(e.args.slice(1))+")";if("call"==i)return t(e.func)+"("+e.args.map(t).join(", ")+")";if("ref"==i)return"refs["+e.index+"]";if("bool"==i)return""+e.value;if("if"==i)return"(context.bool("+t(e.co)+") ? "+t(e.th)+" : "+t(e.el)+")";if("lambda"==i)return"(function("+e.vars.join(", ")+"){ return("+t(e.body)+") })";if("var"==i)return e.name;if("matrix"==i)return n(e.value);if("null"==i)return"null";throw Error("Cannot compile expression "+i)}function n(e){return"[ "+e.map(t).join(", ")+" ]"}var i,r=o(e),a=r.call(e),l=E[a];return l?l.clone(e.sheet,e.row,e.col):(i=t(s(e.ast,function(e){return{type:"return",value:e}})),i=["function(){","var context = this, refs = context.formula.absrefs",i,"}"].join(";\n"),l=new k.Formula(e.refs,S(i),r,e.sheet,e.row,e.col),E[a]=l,l)}function l(e){return e}function u(n,i){function r(e,t){var n=o();return null==n||null!=e&&n.type!==e||null!=t&&n.value!==t?null:n}function o(){return null==C&&(C=a()),C}function s(){if(null!=C){var e=C;return C=null,e}return a()}function a(){var e,t=n.peek();return t&&("sym"!=t.type&&"rc"!=t.type&&"num"!=t.type||(e=k(8,c)||k(6,f)||k(6,p)||k(4,m)||k(4,g)||k(2,v)||k(2,_)),e||(e=n.next())),e}function u(r,o){var s,a,l,u,c;if("rc"==r.type)return!r.rel||i.forEditor||null!=i.row&&null!=i.col||n.croak("Cannot read relative cell in RC notation"),new w(r.row,r.col,r.rel);if("num"==r.type)return r.value<=1048577?F(new w(t(r.value),o?-(1/0):+(1/0),2)):null;if(s=r.value,a=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(s))return l=t(a[4]),u=e(a[2]),l<=1048576&&u<=16383?F(new w(t(a[4]),e(a[2]),(a[1]?0:1)|(a[3]?0:2))):null;if(c="$"==s.charAt(0),c&&(s=s.substr(1)),/^\d+$/.test(s)){if(l=t(s),l<=1048576)return F(new w(t(s),o?-(1/0):+(1/0),c?0:2))}else if(u=e(s),u<=16383)return F(new w(o?-(1/0):+(1/0),e(s),c?0:1))}function c(e,t,n,i,r,o,s,a){if("sym"==e.type&&"op"==t.type&&":"==t.value&&"sym"==n.type&&"punc"==i.type&&"!"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&"op"==o.type&&":"==o.value&&("sym"==s.type||"rc"==s.type||"num"==s.type&&s.value==s.value|0)&&s.type==r.type&&("punc"!=a.type||"("!=a.value||s.space)){var l=u(r,!0),c=u(s,!1);if(l&&c)return x(7),R(new b(l.setSheet(e.value,!0),c.setSheet(n.value,!0)).setSheet(e.value,!0),e,s)}}function f(e,t,n,i,r,o){var s,a;if("sym"==e.type&&"op"==t.type&&":"==t.value&&"sym"==n.type&&"punc"==i.type&&"!"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&("punc"!=o.type||"("!=o.value||r.space)&&(s=u(r)))return x(5),a=s.clone(),R(new b(s.setSheet(e.value,!0),a.setSheet(n.value,!0)).setSheet(e.value,!0),e,r)}function p(e,t,n,i,r,o){if("sym"==e.type&&"punc"==t.type&&"!"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&"op"==i.type&&":"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&("punc"!=o.type||"("!=o.value||r.space)){var s=u(n,!0),a=u(r,!1);if(s&&a)return x(5),R(new b(s,a).setSheet(e.value,!0),e,r)}}function m(e,t,n,i){if("sym"==e.type&&"punc"==t.type&&"!"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&("punc"!=i.type||"("!=i.value||n.space)){x(3);var r=u(n);return r&&isFinite(r.row)||(r=new y(n.value)),R(r.setSheet(e.value,!0),e,n)}}function g(e,t,n,i){if(("sym"==e.type||"rc"==e.type||"num"==e.type&&e.value==e.value|0)&&"op"==t.type&&":"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&("punc"!=i.type||"("!=i.value||n.space)){var r=u(e,!0),o=u(n,!1);if(r&&o)return x(3),R(new b(r,o),e,n)}}function v(e,t){if(("sym"==e.type||"rc"==e.type)&&("punc"!=t.type||"("!=t.value||e.space)){var n=u(e);if(n&&isFinite(n.row)&&isFinite(n.col))return x(1),R(n,e,e)}}function _(e,t){if("sym"==e.type&&"punc"==t.type&&"("==t.value&&!e.space)return e.type="func",x(1),e}var k,x,C,F,R;return n=h(d(n),i),k=n.ahead,x=n.skip,C=null,F=null!=i.row&&null!=i.col?function(e){return 1&e.rel&&(e.col-=i.col),2&e.rel&&(e.row-=i.row),e}:l,R=i.forEditor?function(e,t,n){return e.begin=t.begin,e.end=n.end,e}:l,{peek:o,next:s,croak:n.croak,eof:n.eof,is:r}}function c(e){return" \t\n ​".indexOf(e)>=0}function h(e,t){function n(e){return/[0-9]/i.test(e)}function i(e){return/[a-z$_]/i.test(e)||e.toLowerCase()!=e.toUpperCase()}function r(e){return i(e)||n(e)||"."==e}function o(e){return e in x}function s(e){return"!;(){}[]".indexOf(e)>=0}function a(){var e=!1,t=F(function(t){return"."==t?!e&&(e=!0,!0):n(t)});return{type:"num",value:parseFloat(t)}}function l(t,n){return{type:"sym",value:t,upper:t.toUpperCase(),space:c(e.peek()),quote:n}}function u(e,t,n){var i,r;return e||t||n?!e&&!n||e&&n?(i=e&&/-$/.test(e),r=parseInt(t,10),i&&(r=-r),e||r--,r):void 0:0}function h(){var t,n,i=e.lookingAt(/^R(\[-?)?([0-9]+)?(\])?C(\[-?)?([0-9]+)?(\])?/i);return i&&(t=u(i[1],i[2],i[3]),n=u(i[4],i[5],i[6]),null!=t&&null!=n)?(e.skip(i),{type:"rc",row:t,col:n,rel:(i[4]||!(i[4]||i[5]||i[6])?1:0)|(i[1]||!(i[1]||i[2]||i[3])?2:0)}):l(F(r))}function d(){return e.next(),{type:"str",value:e.readEscaped('"')}}function f(){return e.next(),l(e.readEscaped("'"),!0)}function p(){return{type:"op",value:F(function(e,t){return t+e in x})}}function m(){return{type:"punc",value:e.next()}}function g(){if(e.eof())return null;var r,l=e.peek();return'"'==l?d():"'"==l?f():n(l)||"."==l?a():i(l)?h():o(l)?p():s(l)?m():(r=e.lookingAt(/^#([a-z\/]+)[?!]?/i))?(e.skip(r),{type:"error",value:r[1]}):(t.forEditor||e.croak("Can't handle character: "+l),{type:"error",value:e.next()})}function v(){for(var n,i;k.length<=C;)F(c),n=e.pos(),i=g(),t.forEditor&&i&&(i.begin=n,i.end=e.pos()),k.push(i);return k[C]}function b(){var e=v();return e&&C++,e}function w(e,t){for(var n=C,i=[];e-- >0;)i.push(b()||A);return C=n,t.apply(i,i)}function y(e){C+=e}function _(){return null==v()}var k=[],C=0,F=e.readWhile;return{next:b,peek:v,eof:_,croak:e.croak,ahead:w,skip:y}}function d(e){function t(){return h}function n(){var t=e.charAt(h++);return"\n"==t?(d++,f=0):f++,t}function i(){return e.charAt(h)}function r(){return""===i()}function o(t){throw new C(t+" (input: "+e+")",h)}function s(t){if("string"==typeof t)e.substr(h,t.length)!=t&&o("Expected "+t),a(t.length);else if(t instanceof RegExp){var n=t.exec(e.substr(h));if(n)return a(n[0].length),n}else a(t[0].length)}function a(e){for(;e-- >0;)n()}function l(e){for(var t,i=!1,o="";!r();)if(t=n(),i)o+=t,i=!1;else if("\\"==t)i=!0;else{if(t==e)break;o+=t}return o}function u(e){for(var t="";!r()&&e(i(),t);)t+=n();return t}function c(t){return t.exec(e.substr(h))}var h=0,d=1,f=0;return{next:n,peek:i,eof:r,croak:o,readWhile:u,readEscaped:l,lookingAt:c,skip:s,forward:a,pos:t}}function f(e,t,n){function i(){var i=e.next();return"sym"==i.type?"TRUE"==i.upper?(i.type="bool",
i.value=!0):"FALSE"==i.upper&&(i.type="bool",i.value=!1):"ref"==i.type&&(i={type:"ref",ref:null!=t&&null!=n?i.absolute(t,n):i,begin:i.begin,end:i.end}),i}var r,o=[];for(e=u(e,{forEditor:!0,row:t,col:n});!e.eof();)o.push(i());return r=o[0],"op"==r.type&&"="==r.value&&(r.type="startexp"),o}function p(e,t){var n=e+t,i=T[n];return i||(i="^(\\d+(COM\\d{3})*(DOT\\d+)?)",i=i.replace(/DOT/g,"\\"+t).replace(/COM/g,"\\"+e),i=RegExp(i),T[n]=i),i}function m(e,t){for(var n="";t-- >0;)n+=e;return n}var g,v,b,w,y,_,k,x,C,F,R,S,E,A,M,D,T;kendo.support.browser.msie&&kendo.support.browser.version<9||(g=kendo.spreadsheet,v=g.Ref,b=g.RangeRef,w=g.CellRef,y=g.NameRef,_=g.calc,k=_.runtime,x=Object.create(null),C=kendo.Class.extend({init:function(e,t){this.message=e,this.pos=t},toString:function(){return this.message}}),function(e){e.forEach(function(t,n){t.forEach(function(t){x[t]=e.length-n})})}([[":"],[" "],[","],["%"],["^"],["*","/"],["+","-"],["&"],["=","<",">","<=",">=","<>"]]),F={type:"bool",value:!0},R={type:"bool",value:!1},S=function(e){return function(t){var n=e[t];return n||(n=e[t]=Function("'use strict';return("+t+")")()),n}}(Object.create(null)),E=Object.create(null),A={type:"eof"},M=[],D=_.registerFormatParser=function(e){M.push(e)},_.parse=function(e,t,n,r){var o,s,a,l,u;if(r instanceof Date)return{type:"date",value:k.dateToSerial(r)};if("number"==typeof r)return{type:"number",value:r};if("boolean"==typeof r)return{type:"boolean",value:r};if(r+="",/^'/.test(r))return{type:"string",value:r.substr(1)};if(/^[0-9.]+%$/.test(r)&&(o=r.substr(0,r.length-1),s=parseFloat(o),!isNaN(s)&&s==o))return{type:"percent",value:s/100};if(/^=/.test(r))return r=r.substr(1),/\S/.test(r)?i(e,t,n,r):{type:"string",value:"="+r};for(a=0;a<M.length;++a)if(l=M[a](r))return l;return"true"==r.toLowerCase()?{type:"boolean",value:!0}:"false"==r.toLowerCase()?{type:"boolean",value:!1}:(u=k.parseDate(r))?{type:"date",value:k.dateToSerial(u)}:(s=parseFloat(r),!isNaN(s)&&r.length>0&&s==r?{type:"number",value:s}:{type:"string",value:r})},_.parseNameDefinition=r,_.parseFormula=i,_.parseReference=n,_.compile=a,_.InputStream=d,_.ParseError=C,_.tokenize=f,D(function(e){var t,n,i,r,o;return(t=/^(\d+):(\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),{type:"date",format:"hh:mm",value:k.packTime(n,i,0,0)}):(t=/^(\d+):(\d+)(\.\d+)$/.exec(e))?(i=parseInt(t[1],10),r=parseInt(t[2],10),o=1e3*parseFloat(t[3]),{type:"date",format:"mm:ss.00",value:k.packTime(0,i,r,o)}):(t=/^(\d+):(\d+):(\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),r=parseInt(t[3],10),{type:"date",format:"hh:mm:ss",value:k.packTime(n,i,r,0)}):(t=/^(\d+):(\d+):(\d+)(\.\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),r=parseInt(t[3],10),o=1e3*parseFloat(t[4]),{type:"date",format:"hh:mm:ss.00",value:k.packTime(n,i,r,o)}):void 0}),D(function(e){var t,n,i,r=kendo.culture(),o=r.numberFormat[","],s=r.numberFormat["."],a=r.numberFormat.currency.symbol,l=p(o,s),u=RegExp("^\\s*\\"+a+"\\s*"),c=1,h="",f="",g=!1;if(e=d(e.replace(/^\s+|\s+$/g,"")),e.skip(/^-\s*/)&&(c=-1),(t=e.skip(u))&&(g=!0,h+='"'+t[0]+'"'),e.skip(/^-\s*/)){if(c<0)return null;c=-1}if(!(n=e.skip(l)))return null;if(h+="#",t=e.skip(u)){if(g)return null;g=!0,f='"'+t[0]+'"'}return e.eof()?((n[2]||g)&&(h+=",#"),n[3]&&(h+="."+m("0",n[3].length-1)),i=n[0].replace(RegExp("\\"+o,"g"),"").replace(RegExp("\\"+s,"g"),"."),h+=f,g&&(h+=";-"+h),{type:"number",format:h,value:c*parseFloat(i)}):null}),T={})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/excel-reader.min",["kendo.core.min","kendo.color.min","util/parse-xml.min","spreadsheet/calc.min"],e)}(function(){"use strict";function e(e,t,i){var r=new FileReader;r.onload=function(e){var r=new JSZip(e.target.result);n(r,t,i)},r.readAsArrayBuffer(e)}function t(e){return e=/^\//.test(e)?e.substr(1):"xl/"+e}function n(e,t,n){var r,a=d(e),l=f(e,"_rels/workbook.xml"),u=m(e,l.byType.theme[0]),c=p(e,u),b=[],y=0;h(e,"xl/workbook.xml",{enter:function(n,i){var r,o,u,h;this.is(M)?(r=i["r:id"],o=l.byId[r],u=i.name,h=s(e,o),b.push({workbook:t,zip:e,strings:a,styles:c,file:o,options:{name:u,rows:Math.max(t.options.rows||0,h.rows),columns:Math.max(t.options.columns||0,h.cols),columnWidth:h.columnWidth,rowHeight:h.rowHeight}})):this.is(N)&&i.activeTab&&(y=g(i.activeTab))},text:function(e){var n,i,r,o=this.is(C);!o||v(o["function"])||v(o.vbProcedure)||(n=o.localSheetId,i=null,null!=n&&(i=b[n].options.name),r=o.name,i&&(r="'"+i.replace(/\'/g,"\\'")+"'!"+r),t.defineName(r,e,v(o.hidden)))}}),r=new w.Deferred,r.progress(function(e){n&&n.notify(e)}).then(function(){var e=t.sheets();o(e),t.activeSheet(e[y]),n&&n.resolve()}),i(b,t,r)}function i(e,t,n){var i,o=(new w.Deferred).resolve();for(i=0;i<e.length;i++)!function(i,s){o=o.then(function(){var o,a,l=t.insertSheet(i.options);return l.suspendChanges(!0),o=r(l,i),a={sheet:l,progress:s/(e.length-1)},o.then(function(){n.notify(a)}),o})}(e[i],i);o.then(function(){n.resolve()})}function r(e,t){var n=new w.Deferred;return setTimeout(function(){u(t.zip,t.file,e,t.strings,t.styles),n.resolve()},0),n}function o(e){for(var t=0;t<e.length;t++)e[t].suspendChanges(!1).triggerChange({recalc:!0})}function s(e,n){var i={rows:0,cols:0};return h(e,t(n),{enter:function(e,t){if("dimension"==e){var n=_(t.ref);n.bottomRight&&(i.cols=n.bottomRight.col+1,i.rows=n.bottomRight.row+1)}else"sheetFormatPr"===e?(t.defaultColWidth&&(i.columnWidth=a(parseFloat(t.defaultColWidth))),t.defaultRowHeight&&(i.rowHeight=l(parseFloat(t.defaultRowHeight)))):this.is(E)&&this.exit()}}),i}function a(e){var t=7,n=(256*e+Math.floor(128/t))/256;return Math.floor(n)*t}function l(e){return 1.5625*e}function u(e,n,i,r,o){var s,u,d,p,m,b=i._columns._count,w=null,y=n.replace(/worksheets\//,"worksheets/_rels/"),C=f(e,y);h(e,t(n),{enter:function(e,t){var n,r,h,f,y,F,M,D,T,B;if(this.is(k))d=null,p=null,m=null,s=t.r,null==s&&(s=_(w),s.col++,s=""+s),w=s,u=t.t,n=t.s,null!=n&&c(i,s,o,n);else if(this.is(R))i.range(t.ref).merge();else if(this.is(x)){if(r=g(t.min)-1,h=Math.min(b,g(t.max))-1,t.width&&(f=a(parseFloat(t.width)),0!==f&&i._columns.values.value(r,h,f)),"1"===t.hidden||0===f)for(y=r;y<=h;y++)i.hideColumn(y)}else this.is(E)?(F=g(t.r)-1,t.ht&&(M=l(parseFloat(t.ht)),0!==M&&i._rows.values.value(F,F,M)),"1"!==t.hidden&&0!==M||i.hideRow(F)):this.is(A)?t.activeCell&&(D=_(t.activeCell),i.select(D,!0)):this.is(S)?"frozen"==t.state&&(t.xSplit&&i.frozenColumns(g(t.xSplit)),t.ySplit&&i.frozenRows(g(t.ySplit))):this.is(I)?i.showGridLines(v(t.showGridLines,!0)):this.is(z)&&(T=t["r:id"],B=C.byId[T],B&&i.range(t.ref).link(B))},leave:function(e){if(this.is(k)){if(null!=p)try{i.range(m||s).formula(p)}catch(t){i.range(m||s).value(p).background("#ffaaaa")}else if(null!=d){var n=i.range(s);n._get("formula")||(u&&"n"!=u?"s"==u?d=r[g(d)]:"b"==u?d="1"===d:"d"==u&&(d=kendo.parseDate(d)):d=parseFloat(d),null!=d&&n.value(d))}}else"cols"==e?i._columns._refresh():"sheetData"==e&&i._rows._refresh()},text:function(e){var t;this.is(L)||this.is(D)?d=e:(t=this.is(F))&&(p=e,"shared"==t.t&&(m=t.ref))}})}function c(e,t,n,i){function r(e){var t="string"==typeof e?e:e.formatCode;null==t||/^general$/i.test(t)||(t=t.replace(/^\[\$-[0-9]+\]/,""),h.format(t))}function o(e){"solid"==e.type&&h.background(e.color)}function s(e){h.fontFamily(e.name),h._property("fontSize",e.size),e.bold&&h.bold(!0),e.italic&&h.italic(!0)}function a(e){function t(t,n){var i,r,o=e[t];o&&(i=P[o.style],0!==i&&(r=o.color,null==r&&(r="#000"),h._property(n,{size:i,color:r})))}t("left","borderLeft"),t("top","borderTop"),t("right","borderRight"),t("bottom","borderBottom")}function l(e,t){var n=d[e];if(null!=n&&!n)return!1;if(c=d[t],u&&null==c){if(n=u[e],null!=n&&!n)return!1;c=u[t]}return null!=c}var u,c,h=e.range(t),d=n.inlineStyles[i];d.xfId&&(u=n.namedStyles[d.xfId]),l("applyBorder","borderId")&&a(n.borders[c]),l("applyFont","fontId")&&s(n.fonts[c]),l("applyAlignment","textAlign")&&h.textAlign(c),l("applyAlignment","verticalAlign")&&h.verticalAlign(c),l("applyAlignment","wrapText")&&h._property("wrap",c),l("applyFill","fillId")&&o(n.fills[c]),l("applyNumberFormat","numFmtId")&&r(n.numFmts[c]||H[c])}function h(e,t,n){var i=e.files[t];i&&y(i.asUint8Array(),n)}function d(e){var t=[],n=null;return h(e,"xl/sharedStrings.xml",{leave:function(){this.is(B)&&(t.push(n),n=null)},text:function(e){this.is(T)&&(null==n&&(n=""),n+=e)}}),t}function f(e,n){var i={byId:{},byType:{theme:[]}};return h(e,t(n)+".rels",{enter:function(e,t){var n,r;"Relationship"==e&&(i.byId[t.Id]=t.Target,n=t.Type.match(/\w+$/)[0],r=i.byType[n]||[],r.push(t.Target),i.byType[n]=r)}}),i}function p(e,t){function n(e){function t(t){null!=e[t]&&(n[t]=v(e[t]))}var n={borderId:g(e.borderId),fillId:g(e.fillId),fontId:g(e.fontId),numFmtId:g(e.numFmtId),pivotButton:v(e.pivotButton),quotePrefix:v(e.quotePrefix),xfId:g(e.xfId)};return t("applyAlignment"),t("applyBorder"),t("applyFill"),t("applyFont"),t("applyNumberFormat"),t("applyProtection"),n}function i(e){var n,i,r;return e.rgb?b(e.rgb):e.indexed?j[g(e.indexed)]:e.theme?(n=t.colorScheme[g(e.theme)])?(i=kendo.parseColor(n),e.tint&&(i=i.toHSL(),r=parseFloat(e.tint),i.l=r<0?i.l*(1+r):i.l*(1-r)+(100-100*(1-r))),i.toCssRgba()):j[0]:void 0}var r={fonts:[],numFmts:{},fills:[],borders:[],namedStyles:[],inlineStyles:[]},o=null,s=null,a=null,l=null;return h(e,"xl/styles.xml",{enter:function(e,t,u){if(this.is(W))r.numFmts[t.numFmtId]=t;else if(this.is(O))r.fonts.push(o={});else if(o)"sz"==e?o.size=parseFloat(t.val):"name"==e?o.name=t.val:"b"==e?o.bold=v(t.val,!0):"i"==e&&(o.italic=v(t.val,!0));else if(this.is(V))r.fills.push(s={});else if(s)"patternFill"==e?s.type=t.patternType:"fgColor"==e&&"solid"===s.type?s.color=i(t):"bgColor"==e&&"solid"!==s.type&&(s.color=i(t));else if(this.is($))r.borders.push(a={});else if(a){if(/^(?:left|top|right|bottom)$/.test(e)&&t.style&&(a[e]={style:t.style}),"color"==e){var c=this.stack[this.stack.length-2].$tag;a[c].color=i(t)}}else this.is(q)?(l=n(t),r.namedStyles.push(l),u&&(l=null)):this.is(U)?(l=n(t),r.inlineStyles.push(l),u&&(l=null)):l&&"alignment"==e&&(/^(?:left|center|right|justify)$/.test(t.horizontal)&&(l.textAlign=t.horizontal),/^(?:top|center|bottom)$/.test(t.vertical)&&(l.verticalAlign=t.vertical),null!=t.wrapText&&(l.wrapText=v(t.wrapText)))},leave:function(e){this.is(O)?o=null:this.is(V)?s=null:this.is($)?a=null:"xf"==e&&(l=null)}}),r}function m(e,n){function i(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}var r=[],o={colorScheme:r},s=t(n);return e.files[s]&&(h(e,s,{enter:function(e,t){this.is(J)?r.push(b("window"==t.val?"FFFFFFFF":"FF000000")):this.is(K)&&r.push(b("FF"+t.val))}}),r.length>3&&(i(r,0,1),i(r,2,3))),o}function g(e){return null==e?null:parseInt(e,10)}function v(e,t){return null==e?t:"true"==e||e===!0||1==e}function b(e){var t=/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);return"rgba("+parseInt(t[2],16)+", "+parseInt(t[3],16)+", "+parseInt(t[4],16)+", "+parseInt(t[1],16)/255+")"}var w,y,_,k,x,C,F,R,S,E,A,M,D,T,B,L,N,I,z,P,H,$,V,O,U,q,W,j,K,J;kendo.support.browser.msie&&kendo.support.browser.version<9||(w=kendo.jQuery,y=kendo.util.parseXML,_=kendo.spreadsheet.calc.parseReference,k=["sheetData","row","c"],x=["cols","col"],C=["definedNames","definedName"],F=["sheetData","row","c","f"],R=["mergeCells","mergeCell"],S=["sheetViews","sheetView","pane"],E=["sheetData","row"],A=["sheetViews","sheetView","selection"],M=["sheets","sheet"],D=["sheetData","row","c","is"],T=["t"],B=["si"],L=["sheetData","row","c","v"],N=["bookViews","workbookView"],I=["sheetViews","sheetView"],z=["hyperlinks","hyperlink"],P={none:0,thin:1,medium:2,dashed:1,dotted:1,thick:3,"double":3,hair:1,mediumDashed:2,dashDot:1,mediumDashDot:2,dashDotDot:1,mediumDashDotDot:2,slantDashDot:1},H={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"mm-dd-yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"},$=["borders","border"],V=["fills","fill"],O=["fonts","font"],U=["cellXfs","xf"],q=["cellStyleXfs","xf"],W=["numFmts","numFmt"],j=[b("FF000000"),b("FFFFFFFF"),b("FFFF0000"),b("FF00FF00"),b("FF0000FF"),b("FFFFFF00"),b("FFFF00FF"),b("FF00FFFF"),b("FF000000"),b("FFFFFFFF"),b("FFFF0000"),b("FF00FF00"),b("FF0000FF"),b("FFFFFF00"),b("FFFF00FF"),b("FF00FFFF"),b("FF800000"),b("FF008000"),b("FF000080"),b("FF808000"),b("FF800080"),b("FF008080"),b("FFC0C0C0"),b("FF808080"),b("FF9999FF"),b("FF993366"),b("FFFFFFCC"),b("FFCCFFFF"),b("FF660066"),b("FFFF8080"),b("FF0066CC"),b("FFCCCCFF"),b("FF000080"),b("FFFF00FF"),b("FFFFFF00"),b("FF00FFFF"),b("FF800080"),b("FF800000"),b("FF008080"),b("FF0000FF"),b("FF00CCFF"),b("FFCCFFFF"),b("FFCCFFCC"),b("FFFFFF99"),b("FF99CCFF"),b("FFFF99CC"),b("FFCC99FF"),b("FFFFCC99"),b("FF3366FF"),b("FF33CCCC"),b("FF99CC00"),b("FFFFCC00"),b("FFFF9900"),b("FFFF6600"),b("FF666699"),b("FF969696"),b("FF003366"),b("FF339966"),b("FF003300"),b("FF333300"),b("FF993300"),b("FF993366"),b("FF333399"),b("FF333333"),b("FF000000"),b("FFFFFFFF")],K=["a:clrScheme","*","a:srgbClr"],J=["a:clrScheme","*","a:sysClr"],kendo.spreadsheet.readExcel=e,kendo.spreadsheet._readSheet=u,kendo.spreadsheet._readStrings=d,kendo.spreadsheet._readStyles=p,kendo.spreadsheet._readTheme=m,kendo.spreadsheet._readWorkbook=n)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/workbook.min",["kendo.core.min","spreadsheet/runtime.min","spreadsheet/references.min","spreadsheet/excel-reader.min"],e)}(function(){!function(e){function t(e,t){function n(e,t,n){return void 0!==e?e:void 0!==t?t:n}var i,r,o,s,a,l,u=n(e.rowCount,t.rows,200),c=n(e.columnCount,t.columns,50),h=n(e.rowHeight,t.rowHeight,20),d=n(e.columnWidth,t.columnWidth,64),f=n(e.headerHeight,t.headerHeight,20),p=n(e.headerWidth,t.headerWidth,32);if(void 0!==e.rows)for(i=0;i<e.rows.length;++i)if(r=e.rows[i],o=n(r.index,i),o>=u&&(u=o+1),r.cells)for(s=0;s<r.cells.length;++s)a=r.cells[s],l=n(a.index,s),l>=c&&(c=l+1);return{rowCount:u,columnCount:c,rowHeight:h,columnWidth:d,headerHeight:f,headerWidth:p}}var n,i,r,o,s;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=e.spreadsheet.calc.runtime.Formula,r=e.spreadsheet.Ref,o=e.spreadsheet.CalcError,s=e.Observable.extend({init:function(t,n){e.Observable.fn.init.call(this),this.options=t,this._view=n,this._sheets=[],this._sheetsSearchCache={},this._sheet=this.insertSheet({rows:this.options.rows,columns:this.options.columns,rowHeight:this.options.rowHeight,columnWidth:this.options.columnWidth,headerHeight:this.options.headerHeight,headerWidth:this.options.headerWidth,dataSource:this.options.dataSource}),this.undoRedoStack=new e.util.UndoRedoStack,this.undoRedoStack.bind(["undo","redo"],this._onUndoRedo.bind(this)),this._context=new e.spreadsheet.FormulaContext(this),this._validationContext=new e.spreadsheet.ValidationFormulaContext(this),this._names=Object.create(null),this.fromJSON(this.options)},clipboard:function(){return this._clipboard||(this._clipboard=new e.spreadsheet.Clipboard(this)),this._clipboard},destroy:function(){this.unbind(),this._clipboard&&this._clipboard.destroy()},events:["change","excelImport","excelExport"],_sheetChange:function(e){this.trigger("change",e)},_sheetCommandRequest:function(e){this.trigger("commandRequest",e)},_inputForRef:function(t){return new e.spreadsheet.Range(t,this._sheet).input()},_onUndoRedo:function(e){e.command.range().select()},execute:function(t){var i,r=n.extend({workbook:this},t.options),o=new e.spreadsheet[t.command](r),s=this.activeSheet();return r.origin&&o.origin(r.origin),o.range(r.operatingRange?r.operatingRange:r.editActiveCell?s.activeCellSelection():s.selection()),i=o.exec(),i&&"error"===i.reason||(o.cannotUndo?this.undoRedoStack.clear():this.undoRedoStack.push(o)),i},resetFormulas:function(){this._sheets.forEach(function(e){e.resetFormulas()})},resetValidations:function(){this._sheets.forEach(function(e){e.resetValidations()})},refresh:function(e){e.recalc&&(this.resetFormulas(),this.resetValidations(),this._sheet.recalc(this._context),this._sheet.revalidate(this._validationContext))},activeSheet:function(t){return void 0===t?this._sheet:void(this.sheetByName(t.name())&&(this._sheet=t,t.triggerChange(e.spreadsheet.ALL_REASONS)))},moveSheetToIndex:function(e,t){var n=this.sheetIndex(e),i=this._sheets;n!==-1&&(this._sheetsSearchCache={},i.splice(t,0,i.splice(n,1)[0]),this.trigger("change",{sheetSelection:!0}))},insertSheet:function(t){var n,i,r,o,s,a;if(t=t||{},n=this,i="number"==typeof t.index?t.index:n._sheets.length,o=n._sheets,s=function(e){e=e?e:1;var t="Sheet"+e;return n.sheetByName(t)?s(e+1):t},!t.name||!n.sheetByName(t.name))return this._sheetsSearchCache={},r=t.name||s(),a=new e.spreadsheet.Sheet(t.rows||this.options.rows,t.columns||this.options.columns,t.rowHeight||this.options.rowHeight,t.columnWidth||this.options.columnWidth,t.headerHeight||this.options.headerHeight,t.headerWidth||this.options.headerWidth),a._workbook=this,a._name(r),a.bind("change",this._sheetChange.bind(this)),a.bind("commandRequest",this._sheetCommandRequest.bind(this)),o.splice(i,0,a),t.data&&a.fromJSON(t.data),t.dataSource&&a.setDataSource(t.dataSource),this.trigger("change",{sheetSelection:!0}),a},sheets:function(){return this._sheets.slice()},sheetByName:function(e){return this._sheets[this.sheetIndex(e)]},sheetByIndex:function(e){return this._sheets[e]},sheetIndex:function(e){var t,n=this._sheets,i=("string"==typeof e?e:e.name()).toLowerCase(),r=this._sheetsSearchCache[i];if(r>=0)return r;for(r=0;r<n.length;r++)if(t=n[r].name().toLowerCase(),this._sheetsSearchCache[t]=r,t===i)return r;return-1},renameSheet:function(e,t){var n=e.name().toLowerCase();if(t&&n!==t.toLowerCase()&&!this.sheetByName(t)&&(e=this.sheetByName(n)))return this._sheetsSearchCache={},this._sheets.forEach(function(e){e._forFormulas(function(e){e.renameSheet(n,t)})}),this.forEachName(function(e,o){e.nameref.renameSheet(n,t)&&(this.undefineName(o),e.name=e.nameref.print(),this.nameDefinition(e.name,e)),(e.value instanceof r||e.value instanceof i)&&e.value.renameSheet(n,t)}.bind(this)),e._name(t),this.trigger("change",{sheetSelection:!0}),e},removeSheet:function(e){var t,n=this,i=n._sheets,r=e.name(),o=n.sheetIndex(e);1!==i.length&&(this._sheetsSearchCache={},o>-1&&(e.unbind(),i.splice(o,1),n.activeSheet().name()===r?(t=i[o===i.length?o-1:o],n.activeSheet(t)):this.trigger("change",{recalc:!0,sheetSelection:!0})))},_clearSheets:function(){for(var e=0;e<this._sheets.length;e++)this._sheets[e].unbind();this._sheets=[],this._sheetsSearchCache={},this._names={}},fromJSON:function(e){var n,i,r,o;if(e.sheets)for(this._clearSheets(),n=0;n<e.sheets.length;n++)i=e.sheets[n],r=t(i,this.options),o=this.insertSheet({rows:r.rowCount,columns:r.columnCount,rowHeight:r.rowHeight,columnWidth:r.columnWidth,headerHeight:r.headerHeight,headerWidth:r.headerWidth,data:i}),i.dataSource&&o.setDataSource(i.dataSource);this.activeSheet(e.activeSheet?this.sheetByName(e.activeSheet):this._sheets[0]),e.names&&e.names.forEach(function(e){this.defineName(e.name,e.value,e.hidden)},this)},toJSON:function(){this.resetFormulas(),this.resetValidations();var e=Object.keys(this._names).map(function(e){var t=this._names[e],n=t.value;return n instanceof r||n instanceof i?n=n.print(0,0,!0):n instanceof o?n+="":n=JSON.stringify(n),{value:n,hidden:t.hidden,name:t.name,sheet:t.nameref.sheet,localName:t.nameref.name}},this);return{activeSheet:this.activeSheet().name(),sheets:this._sheets.map(function(e){return e.recalc(this._context),e.revalidate(this._validationContext),e.toJSON()},this),names:e}},fromFile:function(t){var i=new n.Deferred,r=i.promise(),o={file:t,promise:r};return t&&!this.trigger("excelImport",o)?(this._clearSheets(),e.spreadsheet.readExcel(t,this,i)):i.reject(),r},saveAsExcel:function(t){var i,r;t=n.extend({},this.options.excel,t),i=this.toJSON(),this.trigger("excelExport",{workbook:i})||(r=new e.ooxml.Workbook(i),e.saveAs({dataURI:r.toDataURL(),fileName:i.fileName||t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy}))},draw:function(t,n){"function"!=typeof t||n||(n=t,t={});var i=[],r=this._sheets;!function o(s){if(s<r.length)r[s].draw(e.spreadsheet.SHEETREF,t,function(e){i.push(e),o(s+1)});else{var a=i[0];for(s=1;s<i.length;++s)a.children=a.children.concat(i[s].children);n(a)}}(0)},nameForRef:function(e,t){var n,i,o,s;void 0===t&&(t=e.sheet),t=t.toLowerCase(),n=e+"";for(i in this._names)if(o=this._names[i],s=o.value,s instanceof r&&(!s.sheet||s.sheet&&t==s.sheet.toLowerCase())&&s+""==n)return o;return{name:n}},defineName:function(t,n,i){var r=e.spreadsheet.calc.parseNameDefinition(t,n);t=r.name.print(),this._names[t.toLowerCase()]={value:r.value,hidden:i,name:t,nameref:r.name}},undefineName:function(e){delete this._names[e.toLowerCase()]},nameValue:function(e){return e=e.toLowerCase(),e in this._names?this._names[e].value:null},nameDefinition:function(e,t){return e=e.toLowerCase(),arguments.length>1&&(void 0===t?delete this._names[e]:this._names[e]=t),this._names[e]},forEachName:function(e){Object.keys(this._names).forEach(function(t){e(this._names[t],t)},this)},adjustNames:function(e,t,n,o){e=e.toLowerCase(),Object.keys(this._names).forEach(function(s){var a=this._names[s],l=a.value;l instanceof r&&l.sheet.toLowerCase()==e?a.value=l.adjust(null,null,null,null,t,n,o):l instanceof i&&l.adjust(e,t?"row":"col",n,o)},this)},options:{}}),e.spreadsheet.Workbook=s,e.PDFMixin&&(e.PDFMixin.extend(s.prototype),s.prototype.saveAsPDF=function(t){var i=new n.Deferred,r=i.promise(),o={promise:r};if(!this.trigger("pdfExport",o))return this._drawPDF(t,i).then(function(t){return e.drawing.exportPDF(t)}).done(function(n){e.saveAs({dataURI:n,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy,proxyTarget:t.proxyTarget}),i.resolve()}).fail(function(e){i.reject(e)}),r},s.prototype._drawPDF=function(e){var t=new n.Deferred,i=function(e){t.resolve(e)};switch(e.area){case"workbook":e.workbook.draw(e,i);break;case"sheet":e.workbook.activeSheet().draw(e,i);break;case"selection":e.workbook.activeSheet().selection().draw(e,i)}return t.promise()}))}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulacontext.min",["kendo.core.min"],e)}(function(){var e,t,n,i,r,o,s,a;kendo.support.browser.msie&&kendo.support.browser.version<9||(e=kendo.spreadsheet,t=e.CellRef,n=e.RangeRef,i=e.UnionRef,r=e.NameRef,o=e.Ref,s=kendo.Class.extend({init:function(e){this.workbook=e},getRefCells:function(e,s,a,l,u){var c,h,d,f,p,m,g,v,b,w,y,_,k,x,C,F,R;if(e instanceof t)return c=this.workbook.sheetByName(e.sheet),c&&e.valid()?(h=c.formula(e),d=c.range(e.row,e.col).value(),null!=h||null!=d?[{formula:h,value:d,row:e.row,col:e.col,sheet:e.sheet,hidden:!!s&&(0===c.columnWidth(e.col)||0===c.rowHeight(e.row))}]:[]):[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];if(e instanceof n){if(f=this.workbook.sheetIndex(e.sheet),p=[],m=f,e.endSheet&&(m=this.workbook.sheetIndex(e.endSheet),f>m&&(g=f,f=m,m=g)),f<0||m<0||!e.valid())return[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];for(;f<=m;)for(c=this.workbook.sheetByIndex(f++),v=c._grid.normalize(e.topLeft),b=c._grid.normalize(e.bottomRight),w=c._grid.cellRefIndex(v),y=c._grid.cellRefIndex(b),_=c._properties.iterator("value",w,y),k=v.col;k<=b.col;++k)for(x=v.row;x<=b.row;++x)C=c._grid.index(x,k),h=c._properties.get("formula",C),d=_.at(C),null==h&&null==d||p.push({formula:h,value:d,row:x,col:k,sheet:c.name(),hidden:!!s&&(0===c.columnWidth(k)||0===c.rowHeight(x))});return p}if(e instanceof i){for(F=[],f=0;f<e.refs.length;++f)F=F.concat(this.getRefCells(e.refs[f],s,a,l,u));return F}return e instanceof r?(R=this.nameValue(e,a,l,u),R instanceof o?this.getRefCells(R,s,a,l,u):[{value:null==R?new kendo.spreadsheet.calc.runtime.CalcError("NAME"):R}]):[]},nameValue:function(e,t,n,i){var r;return e.hasSheet()?r=this.workbook.nameValue(e.print()):(e=e.clone().setSheet(t,!0),r=this.workbook.nameValue(e.print()),null==r&&(r=this.workbook.nameValue(e.name))),r instanceof o&&(r=r.absolute(n,i)),r},getData:function(e,n,i,o){var s,a=e instanceof t;return e instanceof r&&(a=this.workbook.nameValue(e.name)instanceof t),s=this.getRefCells(e,!1,n,i,o).map(function(e){var t=e.value;return t instanceof kendo.spreadsheet.calc.runtime.Formula&&(t=t.value),t}),a?s[0]:s},onFormula:function(e){var t=this.workbook.sheetByName(e.sheet),n=e.row,i=e.col,r=e.value,s=t.formula({row:n,col:i});return s===e&&(r instanceof o&&(r=this.getData(r,e.sheet,n,i),Array.isArray(r)&&(r=r[0]),void 0===r&&(r=null)),r instanceof kendo.spreadsheet.calc.runtime.Matrix?r.each(function(e,r,o){t._value(n+r,i+o,e)}):t._value(n,i,r),clearTimeout(t._formulaContextRefresh),t._formulaContextRefresh=setTimeout(function(){t.batch(function(){},{layout:!0})},50),!0)}}),a=s.extend({onFormula:function(){return!0}}),e.FormulaContext=s,e.ValidationFormulaContext=a)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/controller.min",["kendo.core.min"],e)}(function(){!function(e){"use strict";function t(e){return e.map(function(e){return'[data-action="'+e+'"]'}).join(",")}var n,i,r,o,s,a,l,u,c,h,d,f,p,m,g,v,b;if(!(e.support.browser.msie&&e.support.browser.version<9)){n=e.jQuery,i=/:alphanum$/,r={up:"up",down:"down",left:"left",right:"right",home:"first-col","ctrl+left":"first-col",end:"last-col","ctrl+right":"last-col","ctrl+up":"first-row","ctrl+down":"last-row","ctrl+home":"first","ctrl+end":"last",pageup:"prev-page",pagedown:"next-page"},o={tab:"next","shift+tab":"previous",enter:"lower","shift+enter":"upper","delete":"clearContents",backspace:"clearContents","shift+:alphanum":"edit",":alphanum":"edit","ctrl+:alphanum":"ctrl","alt+ctrl+:alphanum":"edit",":edit":"edit"},s={wheel:"onWheel","*+mousedown":"onMouseDown",contextmenu:"onContextMenu","*+mousedrag":"onMouseDrag","*+mouseup":"onMouseUp","*+dblclick":"onDblClick",mousemove:"onMouseMove"},a={"*+pageup":"onPageUp","*+pagedown":"onPageDown",mouseup:"onMouseUp","*+cut":"onCut","*+paste":"onPaste","*+copy":"onCopy"},l={esc:"onEditorEsc",enter:"onEditorBlur","alt+enter":"insertNewline","shift+enter":"onEditorBlur",tab:"onEditorBlur","shift+tab":"onEditorBlur"},u=n.extend({focus:"onEditorBarFocus"},l),c=n.extend({focus:"onEditorCellFocus"},l),h={cell:"range",rowheader:"row",columnheader:"column",topcorner:"sheet",autofill:"autofill"},d=t(["cut","copy","paste","insert-left","insert-right","insert-above","insert-below"]),f=t(["unhide-row","unhide-column"]),p=[],m=[],g=[];for(v in r)p.push(v),m.push("shift+"+v);for(v in o)g.push(v);a[p]="onAction",a[m]="onShiftAction",a[g]="onEntryAction",c[p]="onEditorAction",c[m]="onEditorShiftAction",b=e.Class.extend({init:function(t,i){this.view=t,this.workbook(i),this.container=n(t.container),this.clipboardElement=n(t.clipboard),this.cellContextMenu=t.cellContextMenu,this.rowHeaderContextMenu=t.rowHeaderContextMenu,this.colHeaderContextMenu=t.colHeaderContextMenu,this.scroller=t.scroller,this.tabstrip=t.tabstrip,this.sheetsbar=t.sheetsbar,t.nameEditor.bind("enter",this.onNameEditorEnter.bind(this)),t.nameEditor.bind("cancel",this.onNameEditorCancel.bind(this)),t.nameEditor.bind("select",this.onNameEditorSelect.bind(this)),t.nameEditor.bind("delete",this.onNameEditorDelete.bind(this)),this.editor=t.editor,this.editor.bind("change",this.onEditorChange.bind(this)),this.editor.bind("activate",this.onEditorActivate.bind(this)),this.editor.bind("deactivate",this.onEditorDeactivate.bind(this)),this.editor.bind("update",this.onEditorUpdate.bind(this)),n(t.scroller).on("scroll",this.onScroll.bind(this)),this.listener=new e.spreadsheet.EventListener(this.container,this,s),this._enableEditorEvents(),this.sheetsbar&&(this.sheetsbar.bind("select",this.onSheetBarSelect.bind(this)),this.sheetsbar.bind("reorder",this.onSheetBarReorder.bind(this)),this.sheetsbar.bind("rename",this.onSheetBarRename.bind(this)),this.sheetsbar.bind("remove",this.onSheetBarRemove.bind(this))),this.cellContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.rowHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.colHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.cellContextMenu.element.add(this.rowHeaderContextMenu.element).add(this.colHeaderContextMenu.element).on("contextmenu",!1),this.tabstrip&&(this.tabstrip.bind("action",this.onCommandRequest.bind(this)),this.tabstrip.bind("dialog",this.onDialogRequest.bind(this)))},_enableEditorEvents:function(t){void 0===t||t?(this.keyListener=new e.spreadsheet.EventListener(this.clipboardElement,this,a),this.barKeyListener=new e.spreadsheet.EventListener(this.editor.barElement(),this,u),this.inputKeyListener=new e.spreadsheet.EventListener(this.editor.cellElement(),this,c)):(this.keyListener.destroy(),this.barKeyListener.destroy(),this.inputKeyListener.destroy())},_execute:function(e){var t,n=this._workbook.execute(e);return"EditCommand"!==e.command||n||this._workbook.trigger("change",{editorClose:!0}),n&&(this.view.editor.isActive()&&(this.enableEditor(!1),t=this.enableEditor.bind(this,!0,!0)),"error"===n.reason?(this._lastCommandRequest=null,this.view.showError(n,t)):this.view.openDialog(n.reason,{close:t})),n},_activeTooltip:function(){return""+this._workbook.activeSheet().activeCell().simplify()},onContextMenuSelect:function(e){var t,i=n(e.item).data("action");switch(i){case"cut":t={command:"ToolbarCutCommand",options:{workbook:this._workbook}};break;case"copy":t={command:"ToolbarCopyCommand",options:{workbook:this._workbook}};break;case"paste":t={command:"ToolbarPasteCommand",options:{workbook:this._workbook}};break;case"unmerge":t={command:"MergeCellCommand",options:{value:"unmerge"}};break;case"merge":this.view.openDialog("merge");break;case"hide-row":t={command:"HideLineCommand",options:{axis:"row"}};break;case"hide-column":t={command:"HideLineCommand",options:{axis:"column"}};break;case"unhide-row":t={command:"UnHideLineCommand",options:{axis:"row"}};break;case"unhide-column":t={command:"UnHideLineCommand",options:{axis:"column"}};break;case"delete-row":t={command:"DeleteRowCommand"};break;case"delete-column":t={command:"DeleteColumnCommand"}}t&&this._execute(t)},onSheetBarRemove:function(e){var t=this._workbook.sheetByName(e.name);t&&this._workbook.removeSheet(t)},destroy:function(){this.listener.destroy(),this._enableEditorEvents(!1),this.keyListener.destroy(),this.inputKeyListener.destroy()},onSheetBarSelect:function(e){var t,n=this._workbook;t=e.isAddButton?n.insertSheet():n.sheetByName(e.name),n.activeSheet().name()!==t.name()&&n.activeSheet(t)},onSheetBarReorder:function(e){var t=this._workbook.sheetByIndex(e.oldIndex);this._workbook.moveSheetToIndex(t,e.newIndex),this._workbook.activeSheet(t)},onSheetBarRename:function(e){var t=this._workbook.sheetByIndex(e.sheetIndex);return this._workbook.sheetByName(e.name)?void this.view.showError({reason:"error",type:"duplicateSheetName"}):(this._workbook.renameSheet(t,e.name),void this.clipboardElement.focus())},sheet:function(e){this.navigator=e.navigator(),this.axisManager=e.axisManager()},workbook:function(e){this._workbook=e,this.clipboard=e.clipboard(),e.bind("commandRequest",this.onCommandRequest.bind(this))},refresh:function(){var e,t,n=this.editor,i=this._workbook,r=i.activeSheet();this._viewPortHeight=this.view.scroller.clientHeight,this.navigator.height(this._viewPortHeight),n.isActive()||this.isEditorDisabled||(n.enable(r.selection().enable()!==!1),n.value(i._inputForRef(r.activeCell()))),e=r.selection()._ref.simplify(),t=this._workbook.nameForRef(e,r.name()),this.view.nameEditor.value(t.name)},onScroll:function(){this.view.render()},onWheel:function(e){var t=e.originalEvent.deltaX,n=e.originalEvent.deltaY;1===e.originalEvent.deltaMode&&(t*=10,n*=10),this.scrollWith(t,n),e.preventDefault()},onAction:function(e,t){this.navigator.moveActiveCell(r[t]),
e.preventDefault()},onPageUp:function(){this.scrollDown(-this._viewPortHeight)},onPageDown:function(){this.scrollDown(this._viewPortHeight)},onEntryAction:function(e,t){var n,r,s;if(e.mod){switch(n=!0,r=String.fromCharCode(e.keyCode)){case"A":this.navigator.selectAll();break;case"Y":this._workbook.undoRedoStack.redo();break;case"Z":this._workbook.undoRedoStack.undo();break;default:n=!1}n&&e.preventDefault()}else if(s=this._workbook.activeSheet().selection().enable()===!1,"delete"==t||"backspace"==t)s||this._execute({command:"ClearContentCommand"}),e.preventDefault();else if(i.test(t)||":edit"===t){if(s)return void e.preventDefault();":edit"!==t&&this.editor.value(""),this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus()}else this.navigator.navigateInSelection(o[t]),e.preventDefault()},onShiftAction:function(e,t){this.navigator.modifySelection(r[t.replace("shift+","")],this.appendSelection),e.preventDefault()},onMouseMove:function(e){var t,n=this._workbook.activeSheet();n.resizingInProgress()||n.selectionInProgress()||(t=this.objectAt(e),"columnresizehandle"===t.type||"rowresizehandle"===t.type?n.positionResizeHandle(t.ref):n.removeResizeHandle())},onMouseDown:function(e){var t,n=this.objectAt(e);return n.pane&&(this.originFrame=n.pane),"editor"===n.type?(this.onEditorEsc(),this.openCustomEditor(),void e.preventDefault()):this.editor.canInsertRef(!1)&&n.ref?(this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs()),this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection,e.shiftKey),void e.preventDefault()):(this.editor.deactivate(),this.editor.isActive()?void e.preventDefault():(t=this._workbook.activeSheet(),"columnresizehandle"===n.type||"rowresizehandle"===n.type?(t.startResizing({x:n.x,y:n.y}),void e.preventDefault()):"filtericon"===n.type?(this.openFilterMenu(e),void e.preventDefault()):(this._selectionMode=h[n.type],this.appendSelection=e.mod,void this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection,e.shiftKey))))},onContextMenu:function(t){var n,i,r,o,s,a,l=this._workbook.activeSheet();l.resizingInProgress()||(t.preventDefault(),this.cellContextMenu.close(),this.colHeaderContextMenu.close(),this.rowHeaderContextMenu.close(),i={pageX:t.pageX,pageY:t.pageY},r=this.objectAt(i),"columnresizehandle"!==r.type&&"rowresizehandle"!==r.type&&(this.navigator.selectForContextMenu(r.ref,h[r.type]),o=this.navigator._sheet.select()instanceof e.spreadsheet.UnionRef,s=!1,a=!1,"columnheader"==r.type?(n=this.colHeaderContextMenu,s=!o&&this.axisManager.selectionIncludesHiddenColumns()):"rowheader"==r.type?(n=this.rowHeaderContextMenu,s=!o&&this.axisManager.selectionIncludesHiddenRows()):(n=this.cellContextMenu,a=this.navigator.selectionIncludesMergedCells()),n.element.find(d).toggle(!o),n.element.find(f).toggle(s),n.element.find("[data-action=unmerge]").toggle(a),setTimeout(function(){n.open(t.pageX,t.pageY)})))},prevent:function(e){e.preventDefault()},constrainResize:function(e,t){var n=this._workbook.activeSheet(),i=n.resizeHandlePosition();return!i||"outside"===e||"topcorner"===e||t.col<i.col||t.row<i.row},onMouseDrag:function(e){var t,n,i,r;if("sheet"!==this._selectionMode){if(t={pageX:e.pageX,pageY:e.pageY},n=this.objectAt(t),i=this._workbook.activeSheet(),i.resizingInProgress())return void(this.constrainResize(n.type,n.ref)||i.resizeHintPosition({x:n.x,y:n.y}));if("outside"===n.type)return void this.startAutoScroll(n);this.originFrame===n.pane?this.selectToLocation(t):(r=this.originFrame._grid,n.x>r.right&&this.scrollLeft(),n.y>r.bottom&&this.scrollTop(),n.y<r.top||n.x<r.left?this.startAutoScroll(n,t):this.selectToLocation(t)),e.preventDefault()}},onMouseUp:function(e){var t,n,i,r=this._workbook.activeSheet();if(r.completeResizing(),this.navigator.completeSelection(),this.stopAutoScroll(),t=this.editor.activeEditor()){for(n=e.target;n;){if(n===t.element[0])return;n=n.parentNode}i=this.objectAt(e),i&&i.ref&&t.canInsertRef(!1)&&(t.refAtPoint(r.selection()._ref),r._setFormulaSelections(t.highlightedRefs()))}},onDblClick:function(e){var t=this.objectAt(e),n=this._workbook.activeSheet().selection().enable()===!1;"cell"!==t.type||n||(this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus(),this.onEditorUpdate())},onCut:function(e){if(e){var t=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach();this.clipboardElement.append(t.clone(!1)),setTimeout(function(){this.clipboardElement.empty().append(t)}.bind(this))}this._execute({command:"CutCommand",options:{workbook:this.view._workbook}})},clipBoardValue:function(){return this.clipboardElement.html()},onPaste:function(t){var n,i,r,o="",s="";if(this.clipboard.menuInvoked=void 0===t,t){if(!t.originalEvent.clipboardData||!t.originalEvent.clipboardData.getData)return r=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach(),this.clipboardElement.empty(),void setTimeout(function(){var e=this.clipboardElement.html(),t=window.clipboardData.getData("Text").trim();(e||t)&&(this.clipboard.external({html:e,plain:t}),this.clipboardElement.empty().append(r),this._execute({command:"PasteCommand",options:{workbook:this.view._workbook}}),this.clipboard.menuInvoked=!0)}.bind(this));t.preventDefault(),n=!1,i=!1,window.DOMStringList&&t.originalEvent.clipboardData.types instanceof window.DOMStringList?(n=t.originalEvent.clipboardData.types.contains("text/html"),i=t.originalEvent.clipboardData.types.contains("text/plain")):(n=/text\/html/.test(t.originalEvent.clipboardData.types),i=/text\/plain/.test(t.originalEvent.clipboardData.types)),n&&(o=t.originalEvent.clipboardData.getData("text/html")),i&&(s=t.originalEvent.clipboardData.getData("text/plain").trim())}else{if(e.support.browser.msie)return this.clipboardElement.focus().select(),void document.execCommand("paste");this.clipboard.menuInvoked=!0}(o||s)&&(this.clipboard.external({html:o,plain:s}),this._execute({command:"PasteCommand",options:{workbook:this.view._workbook}}))},onCopy:function(e){this.clipboard.menuInvoked=void 0===e,this._execute({command:"CopyCommand",options:{workbook:this.view._workbook}})},scrollTop:function(){this.scroller.scrollTop=0},scrollLeft:function(){this.scroller.scrollLeft=0},scrollDown:function(e){this.scroller.scrollTop+=e},scrollRight:function(e){this.scroller.scrollLeft+=e},scrollWith:function(e,t){this.scroller.scrollTop+=t,this.scroller.scrollLeft+=e},objectAt:function(e){var t=this.container.offset(),n={left:e.pageX-t.left,top:e.pageY-t.top};return this.view.objectAt(n.left,n.top)},selectToLocation:function(e){var t=this.objectAt(e);t.pane&&(this.extendSelection(t),this.lastKnownCellLocation=e,this.originFrame=t.pane),this.stopAutoScroll()},extendSelection:function(e){this.navigator.extendSelection(e.ref,this._selectionMode,this.appendSelection)},autoScroll:function(){var e=this._autoScrollTarget.x,t=this._autoScrollTarget.y,n=this.originFrame._grid,i=this.view.scroller,r=8,o=i.scrollLeft,s=i.scrollTop;e<n.left&&this.scrollRight(-r),e>n.right&&this.scrollRight(r),t<n.top&&this.scrollDown(-r),t>n.bottom&&this.scrollDown(r),s===i.scrollTop&&o===i.scrollLeft?this.selectToLocation(this.finalLocation):this.extendSelection(this.objectAt(this.lastKnownCellLocation))},startAutoScroll:function(e,t){this._scrollInterval||(this._scrollInterval=setInterval(this.autoScroll.bind(this),50)),this.finalLocation=t||this.lastKnownCellLocation,this._autoScrollTarget=e},stopAutoScroll:function(){clearInterval(this._scrollInterval),this._scrollInterval=null},openCustomEditor:function(){this.view.openCustomEditor()},openFilterMenu:function(e){var t=this.objectAt(e),n=this._workbook.activeSheet(),i=n.filterColumn(t.ref),r=this.view.createFilterMenu(i);r.bind("action",this.onCommandRequest.bind(this)),r.bind("action",r.close.bind(r)),r.openFor(e.target)},onEditorChange:function(e){this._workbook.activeSheet().isInEditMode(!1);var t=this._execute({command:"EditCommand",options:{editActiveCell:!0,value:e.value}});t&&"error"===t.reason&&e.preventDefault()},onEditorActivate:function(){var e=this._workbook,t=e.activeSheet();t._setFormulaSelections(this.editor.highlightedRefs()),t.isInEditMode(!0)},onEditorDeactivate:function(){var e=this._workbook.activeSheet();e.isInEditMode(!1),e._setFormulaSelections([])},onEditorUpdate:function(){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs())},onEditorBarFocus:function(){var e=this._workbook.activeSheet().selection().enable()===!1;e||this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()})},onEditorCellFocus:function(){this.editor.scale()},onEditorEsc:function(){this.resetEditorValue(),this.editor.deactivate(),this.clipboardElement.focus()},insertNewline:function(e){e.preventDefault(),this.editor.insertNewline()},onEditorBlur:function(e,t){this.editor.isFiltered()||(this.editor.deactivate(),this.editor.isActive()||(this.clipboardElement.focus(),this.navigator.navigateInSelection(o[t])))},onEditorAction:function(e,t){var n=this.editor,i=this._workbook.activeSheet();n.canInsertRef(!0)&&(this.navigator.moveActiveCell(r[t]),n.activeEditor().refAtPoint(i.selection()._ref),i._setFormulaSelections(n.highlightedRefs()),e.preventDefault())},onEditorShiftAction:function(e,t){var n=this.editor,i=this._workbook.activeSheet();n.canInsertRef(!0)&&(this.navigator.modifySelection(r[t.replace("shift+","")],this.appendSelection),n.activeEditor().refAtPoint(i.selection()._ref),i._setFormulaSelections(n.highlightedRefs()),e.preventDefault())},resetEditorValue:function(){this.editor.value(this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell()))},deactivateEditor:function(e,t){var n=this.view.editor;this._lastCommandRequest={callback:e,options:t},this.isEditorDeactivateBound||(this.isEditorDeactivateBound=!0,n.one("deactivate",function(){this.isEditorDeactivateBound=!1,this._lastCommandRequest&&(this._lastCommandRequest.callback(this._lastCommandRequest.options),this._lastCommandRequest=null)}.bind(this))),n.deactivate(),this.enableEditor(!1)},enableEditor:function(e,t,n){n&&"revert"===n.action&&this.resetEditorValue(),e=void 0===e||e,this._enableEditorEvents(e),this.editor.enableEditing(e),this.isEditorDisabled=!e,this.view.enableClipboard(e),t&&this.editor.focusLastActive()},executeRequest:function(e,t){this.view.editor.isActive()?this.deactivateEditor(e,t):e(t)},onCommandRequest:function(e){var t=function(e){e.command?this._execute(e):this._workbook.undoRedoStack[e.action]()}.bind(this);this.executeRequest(t,e)},onDialogRequest:function(e){var t=function(e){this.enableEditor(!1);var t={pdfExport:this._workbook.options.pdf,excelExport:this._workbook.options.excel,close:this.enableEditor.bind(this,!0,!1)};e.options?n.extend(!0,e.options,t):e.options=t,this.view.openDialog(e.name,e.options)}.bind(this);this.executeRequest(t,e)},onNameEditorEnter:function(){var t,n=this._workbook,i=n.activeSheet(),r=this.view.nameEditor.value(),o=e.spreadsheet.calc.parseReference(r,!0)||n.nameValue(r);return o instanceof e.spreadsheet.Ref?(o.sheet&&o.sheet.toLowerCase()!=i.name().toLowerCase()&&(t=n.sheetByName(o.sheet),t&&(n.activeSheet(t),i=t)),void i.range(o).select()):(o=i.selection()._ref.clone().simplify().setSheet(i.name(),!0),this._execute({command:"DefineNameCommand",options:{name:r,value:o}}),void this.clipboardElement.focus())},onNameEditorCancel:function(){this.clipboardElement.focus()},onNameEditorSelect:function(t){var n,i=t.name,r=this._workbook,o=r.activeSheet(),s=r.nameValue(i);return s instanceof e.spreadsheet.Ref?(s.sheet&&s.sheet.toLowerCase()!=o.name().toLowerCase()&&(n=r.sheetByName(s.sheet),n&&(r.activeSheet(n),o=n)),void o.range(s).select()):void this.clipboardElement.focus()},onNameEditorDelete:function(e){this._execute({command:"DeleteNameCommand",options:{name:e.name}}),this.clipboardElement.focus()}}),e.spreadsheet.Controller=b}}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/view.min",["kendo.core.min","kendo.menu.min","spreadsheet/sheetsbar.min"],e)}(function(){!function(e){function t(e){var t,n=window.getSelection();n.removeAllRanges(),t=document.createRange(),t.selectNodeContents(e),n.addRange(t)}function n(e,t){var n=e.trs[t].children;return n[n.length-2]}function i(e,t){var n=e.trs[t-1],i=e.trs[t].children.length-1;if(n&&i>=0)return n.children[i]}function r(e){return["solid",(e.size||1)+"px",e.color||"#000"].join(" ")}function o(e){return/:\/\//.test(e)||(e="http://"+e),e}function s(t,n,i,s,a,l){function u(t){var i,r=n.link;return r||"object"==typeof n.value&&(r=n.value.link),r?(i={textDecoration:"none"},n.color&&(i.color=n.color),n.underline&&(i.textDecoration="underline"),e.dom.element("a",{href:o(r),style:i,target:"_blank"},t?[t]:[])):t}var c,h,d,f,p,m,g,v,b,w,_,k,x,C,F;if(i||e.spreadsheet.draw.shouldDrawCell(n)){if(c=n.left,h=n.top,d=n.width+1,f=n.height+1,p={},m=n.background,g=null,m&&(g=m,l&&(g=e.parseColor(g).toHSV(),g.v*=.9,g=g.toCssRgba()),g=r({color:g})),m&&(p.backgroundColor=m),n.color&&(p.color=n.color),n.fontFamily&&(p.fontFamily=n.fontFamily),n.underline&&(p.textDecoration="underline"),n.italic&&(p.fontStyle="italic"),n.textAlign&&(p.textAlign=n.textAlign),n.bold&&(p.fontWeight="bold"),n.fontSize&&(p.fontSize=n.fontSize+"px"),n.wrap===!0&&(p.whiteSpace="pre-wrap",p.wordBreak="break-all"),n.borderLeft?(p.borderLeft=r(n.borderLeft),a&&(a[n.left]=!0)):g&&a&&!a[n.left]?p.borderLeft=g:(c++,d--),n.borderTop?(p.borderTop=r(n.borderTop),s&&(s[n.top]=!0)):g&&s&&!s[n.top]?p.borderTop=g:(h++,f--),n.borderRight?(p.borderRight=r(n.borderRight),a&&(a[n.right]=!0)):g&&a&&!a[n.right]?p.borderRight=g:d--,n.borderBottom?(p.borderBottom=r(n.borderBottom),s&&(s[n.bottom]=!0)):g&&s&&!s[n.bottom]?p.borderBottom=g:f--,p.left=c+"px",p.top=h+"px",p.width=d+"px",p.height=f+"px",v=n.value,b=typeof v,n.format&&null!=v?(v=e.spreadsheet.formatting.format(v,n.format),v.__dataType&&(b=v.__dataType)):null!==v&&void 0!==v&&(v=e.dom.text(v)),!p.textAlign)switch(b){case"number":case"date":case"percent":p.textAlign="right";break;case"boolean":p.textAlign="center"}return w=[y.cell],i&&w.push(i),n.enable===!1&&w.push("k-state-disabled"),n.merged&&w.push("k-spreadsheet-merged-cell"),_=n.verticalAlign||"bottom",v=_&&v?e.dom.element("div",{className:"k-vertical-align-"+_},[u(v)]):u(v),k=v?[v]:[],x={style:p},C=n.validation,C&&!C.value&&(k.push(e.dom.element("span",{className:"k-dirty"})),w.push("k-dirty-cell"),x.title=C._getOptions().messageTemplate),x.className=w.join(" "),F=e.dom.element("div",x,k),t.push(F),F}}function a(t,o,s){var a,l,u,c,h,d,f={};if(s.background&&(f.backgroundColor=s.background),s.color&&(f.color=s.color),s.fontFamily&&(f.fontFamily=s.fontFamily),s.underline&&(f.textDecoration="underline"),s.italic&&(f.fontStyle="italic"),s.textAlign&&(f.textAlign=s.textAlign),s.verticalAlign&&(f.verticalAlign="center"===s.verticalAlign?"middle":s.verticalAlign),s.bold&&(f.fontWeight="bold"),s.fontSize&&(f.fontSize=s.fontSize+"px"),s.wrap===!0&&(f.whiteSpace="pre-wrap",f.wordBreak="break-all"),s.borderRight?f.borderRight=r(s.borderRight):s.background&&(f.borderRightColor=s.background),s.borderBottom?f.borderBottom=r(s.borderBottom):s.background&&(f.borderBottomColor=s.background),a=s.value,l=typeof a,s.format&&null!=a&&(a=e.spreadsheet.formatting.format(a,s.format),a.__dataType&&(l=a.__dataType)),!f.textAlign)switch(l){case"number":case"date":case"percent":f.textAlign="right";break;case"boolean":f.textAlign="center"}return u=null,s.enable===!1&&(u="k-state-disabled"),c=t.addCell(o,a,f,u,s.validation),s.borderLeft?(d=n(t,o),h=r(s.borderLeft),d&&h&&(d.attr.style.borderRight=h)):s.background&&(f.borderLeftColor=s.background),s.borderTop?(d=i(t,o),h=r(s.borderTop),d&&h&&(d.attr.style.borderBottom=h)):s.background&&(f.borderTopColor=s.background),c}function l(e,t,n){return e>=t&&e<=n}var u,c,h,d,f,p,m,g,v,b,w,y,_;e.support.browser.msie&&e.support.browser.version<9||(u=e.jQuery,c=e.spreadsheet.CellRef,h=".",d=7,f={view:"k-spreadsheet-view",fixedContainer:"k-spreadsheet-fixed-container",editContainer:"k-spreadsheet-edit-container",scroller:"k-spreadsheet-scroller",viewSize:"k-spreadsheet-view-size",clipboard:"k-spreadsheet-clipboard",cellEditor:"k-spreadsheet-cell-editor",barEditor:"k-spreadsheet-editor",topCorner:"k-spreadsheet-top-corner",filterHeadersWrapper:"k-filter-wrapper",filterRange:"k-filter-range",filterButton:"k-spreadsheet-filter",filterButtonActive:"k-state-active",horizontalResize:"k-horizontal-resize",verticalResize:"k-vertical-resize",icon:"k-icon k-font-icon",iconFilterDefault:"k-i-arrow-s",sheetsBar:"k-spreadsheet-sheets-bar",sheetsBarActive:"k-spreadsheet-sheets-bar-active",sheetsBarInactive:"k-spreadsheet-sheets-bar-inactive",cellContextMenu:"k-spreadsheet-cell-context-menu",rowHeaderContextMenu:"k-spreadsheet-row-header-context-menu",colHeaderContextMenu:"k-spreadsheet-col-header-context-menu"},e.spreadsheet.messages.view={errors:{openUnsupported:"Unsupported format. Please select an .xlsx file.",shiftingNonblankCells:"Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",filterRangeContainingMerges:"Cannot create a filter within a range containing merges",sortRangeContainingMerges:"Cannot sort a range containing merges",validationError:"The value that you entered violates the validation rules set on the cell."},tabs:{home:"Home",insert:"Insert",data:"Data"}},p=e.Class.extend({init:function(){this.cols=[],this.trs=[],this._height=0,this._width=0},addColumn:function(t){this._width+=t;var n=e.dom.element("col",{style:{width:t+"px"}});n.visible=t>0,this.cols.push(n)},addRow:function(t){var n,i=null;i={style:{height:t+"px"}},this._height+=t,n=e.dom.element("tr",i),n.visible=t>0,this.trs.push(n)},addCell:function(t,n,i,r,o){var s,a,l;return null!==n&&void 0!==n||(n=""),n instanceof e.dom.Node||(n=e.dom.text(n)),s=[n],a={style:i},o&&!o.value&&(s.push(e.dom.element("span",{className:"k-dirty"})),r=(r||"")+(r?" ":"")+"k-dirty-cell",a.title=o._getOptions().messageTemplate),r&&(a.className=r),l=e.dom.element("td",a,s),this.trs[t].children.push(l),l},toDomTree:function(t,n,i){this.trs=this.trs.filter(function(e){return e.visible});var r=0;return this.cols=this.cols.filter(function(e,t){return e.visible||(this.trs.forEach(function(e){e.children.splice(t-r,1)}),r++),e.visible},this),e.dom.element("table",{style:{left:t+"px",top:n+"px",height:this._height+"px",width:this._width+"px"},className:i},[e.dom.element("colgroup",null,this.cols),e.dom.element("tbody",null,this.trs)])}}),m='<ul class="#=classNames.cellContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action=merge>Merge</li><li data-action=unmerge>Unmerge</li></ul>',g='<ul class="#=classNames.rowHeaderContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action="delete-row">Delete</li><li data-action="hide-row">Hide</li><li data-action="unhide-row">Unhide</li></ul>',v='<ul class="#=classNames.colHeaderContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action="delete-column">Delete</li><li data-action="hide-column">Hide</li><li data-action="unhide-column">Unhide</li></ul>',e.spreadsheet.ContextMenu=e.ui.ContextMenu,b=e.template('<div class="#=classNames.view#"><div class="#=classNames.fixedContainer#"></div><div class="#=classNames.scroller#"><div class="#=classNames.viewSize#"></div></div><div tabindex="0" class="#=classNames.clipboard#" contenteditable=true></div><div class="#=classNames.cellEditor#"></div></div><div class="#=classNames.sheetsBar#"></div>'+m+g+v),w=e.Class.extend({init:function(t,n){var i,r,o=w.classNames;this.element=t,this.options=u.extend(!0,{messages:e.spreadsheet.messages.view},this.options,n),this._chrome(),this._dialogs=[],t.append(b({classNames:o})),this._formulaInput(),this.wrapper=t.find(h+o.view),this.container=t.find(h+o.fixedContainer)[0],this.scroller=t.find(h+o.scroller)[0],this.clipboard=t.find(h+o.clipboard),this.viewSize=u(this.scroller.firstChild),this.tree=new e.dom.Tree(this.container),this.clipboardContents=new e.dom.Tree(this.clipboard[0]),this.editor=new e.spreadsheet.SheetEditor(this),this._sheetsbar(),i={target:t,animation:!1,showOn:"never"},this.cellContextMenu=new e.spreadsheet.ContextMenu(t.find(h+o.cellContextMenu),i),this.colHeaderContextMenu=new e.spreadsheet.ContextMenu(t.find(h+o.colHeaderContextMenu),i),this.rowHeaderContextMenu=new e.spreadsheet.ContextMenu(t.find(h+o.rowHeaderContextMenu),i),r=e.support.scrollbar(),u(this.container).css({width:this.wrapper[0].clientWidth-r,height:this.wrapper[0].clientHeight-r})},enableClipboard:function(e){this.isClipboardDeactivated=!e,e?this.clipboard.attr("contenteditable",e):this.clipboard.removeAttr("contenteditable")},_resize:function(){var t=e._outerHeight,n=this.tabstrip?t(this.tabstrip.element):0,i=this.formulaBar?t(this.formulaBar.element):0,r=this.sheetsbar?t(this.sheetsbar.element):0;this.wrapper.height(this.element.height()-(n+i+r)),this.tabstrip&&this.tabstrip.quickAccessAdjust()},_chrome:function(){var t,n=u("<div class='k-spreadsheet-action-bar' />").prependTo(this.element),i=u("<div class='k-spreadsheet-name-editor' />").appendTo(n);this.nameEditor=new e.spreadsheet.NameEditor(i),t=u("<div />").appendTo(n),this.formulaBar=new e.spreadsheet.FormulaBar(t),this.options.toolbar&&this._tabstrip()},_formulaInput:function(){var t=this.element.find(h+w.classNames.cellEditor);this.formulaInput=new e.spreadsheet.FormulaInput(t,{autoScale:!0})},_sheetsbar:function(){this.options.sheetsbar&&(this.sheetsbar=new e.spreadsheet.SheetsBar(this.element.find(h+w.classNames.sheetsBar),u.extend(!0,{},this.options.sheetsbar)))},_tabstrip:function(){var t,n=this.options.messages.tabs,i=u.extend(!0,{home:!0,insert:!0,data:!0},this.options.toolbar),r=[];this.tabstrip&&(this.tabstrip.destroy(),this.element.children(".k-tabstrip").remove());for(t in i)(i[t]===!0||i[t]instanceof Array)&&r.push({id:t,text:n[t],content:""});this.tabstrip=new e.spreadsheet.TabStrip(u("<div />").prependTo(this.element),{animation:!1,dataTextField:"text",dataContentField:"content",dataSource:r,toolbarOptions:i,view:this}),this.tabstrip.select(0)},_executeCommand:function(e){this._sheet.trigger("commandRequest",e)},workbook:function(e){this._workbook=e,this.nameEditor._workbook=e},sheet:function(e){this._sheet=e},activeCellRectangle:function(){return this.cellRectangle(this._sheet._viewActiveCell())},_rectangle:function(e,t){return e._grid.boundingRectangle(t.toRangeRef())},isColumnResizer:function(e,t,n){var i,r,o=this._rectangle(t,n);return e-=this._sheet._grid._headerWidth,i=d/2,r=o.right-this.scroller.scrollLeft,r-i<=e&&e<=r+i},isRowResizer:function(e,t,n){var i,r,o=this._rectangle(t,n);return e-=this._sheet._grid._headerHeight,i=d/2,r=o.bottom-this.scroller.scrollTop,r-i<=e&&e<=r+i},isFilterIcon:function(e,t,n,i){var r,o=n._grid,s=o.rows.frozen?0:this.scroller.scrollTop,a=o.columns.frozen?0:this.scroller.scrollLeft;return e-=this._sheet._grid._headerWidth-a,t-=this._sheet._grid._headerHeight-s,r=!1,this._sheet.forEachFilterHeader(i,function(i){if(!r){var o=this._rectangle(n,i);r=n.filterIconRect(o).intersects(e,t)}}.bind(this)),r},isAutoFill:function(e,t,n){var i,r=this._sheet.select();return!(r.size>1)&&(e-=this._sheet._grid._headerWidth,t-=this._sheet._grid._headerHeight,n._grid.columns.frozen||(e+=this.scroller.scrollLeft),n._grid.rows.frozen||(t+=this.scroller.scrollTop),i=this._rectangle(n,r),Math.abs(i.right-e)<8&&Math.abs(i.bottom-t)<8)},isEditButton:function(e,t){var n,i=this._sheet.activeCellCustomEditor();if(i&&(n=this.activeCellRectangle(),e>n.right&&e<=n.right+20&&t>=n.top&&t<=n.bottom))return!0},objectAt:function(e,t){var n,i,r,o,s,a,l,u=this._sheet._grid;return e<0||t<0||e>this.scroller.clientWidth||t>this.scroller.clientHeight?n={type:"outside"}:e<u._headerWidth&&t<u._headerHeight?n={type:"topcorner"}:(i=this.paneAt(e,t),i?(r=i._grid.rows.index(t,this.scroller.scrollTop),o=i._grid.columns.index(e,this.scroller.scrollLeft),s="cell",a=new c(r,o),l=this._sheet.selectionInProgress(),this.isAutoFill(e,t,i)?s="autofill":this.isFilterIcon(e,t,i,a)?s="filtericon":!l&&e<u._headerWidth?(a=new c(r,(-(1/0))),s=this.isRowResizer(t,i,a)?"rowresizehandle":"rowheader"):!l&&t<u._headerHeight?(a=new c((-(1/0)),o),s=this.isColumnResizer(e,i,a)?"columnresizehandle":"columnheader"):this.isEditButton(e,t)&&(s="editor"),n={type:s,ref:a}):n={type:"outside"}),n.pane=i,n.x=e,n.y=t,n},paneAt:function(e,t){return this.panes.filter(function(n){var i=n._grid;return l(t,i.top,i.bottom)&&l(e,i.left,i.right)})[0]},containingPane:function(e){return this.panes.filter(function(t){return!!t._grid.contains(e)})[0]},cellRectangle:function(e){var t=this.containingPane(e)._grid,n=this._sheet._grid.rectangle(e);return n.offset(t.headerWidth-(t.columns.frozen?0:this.scroller.scrollLeft),t.headerHeight-(t.rows.frozen?0:this.scroller.scrollTop))},refresh:function(e){var t,n,i=this._sheet;this.tabstrip&&this.tabstrip.refreshTools(i.range(i.activeCell())),e.sheetSelection&&this.sheetsbar&&this.sheetsbar.renderSheets(this._workbook.sheets(),this._workbook.sheetIndex(this._sheet)),this._resize(),this.viewSize[0].style.height=i._grid.totalHeight()+"px",this.viewSize[0].style.width=i._grid.totalWidth()+"px",e.layout&&(t=i.frozenColumns(),n=i.frozenRows(),this.panes=[this._pane(n,t)],t>0&&this.panes.push(this._pane(n,0,null,t)),n>0&&this.panes.push(this._pane(0,t,n,null)),n>0&&t>0&&this.panes.push(this._pane(0,0,n,t))),e.filter&&this._destroyFilterMenu(),e.activeCell&&(this._focus=i.activeCell().toRangeRef())},createFilterMenu:function(t){var n,i,r,o,s,a;return this._filterMenu&&this._filterMenu.options.column==t?this._filterMenu:(this._destroyFilterMenu(),n=this._sheet,i=n.filter().ref,r=new e.spreadsheet.Range(i,n),o=u("<div />").appendTo(this.element),s={column:t,range:r},a=new e.spreadsheet.FilterMenu(o,s),this._filterMenu=a,a)},selectClipBoardContents:function(){this.isClipboardDeactivated||(this.clipboard.focus(),t(this.clipboard[0]))},scrollIntoView:function(e){var t=!1,n=this.containingPane(e)._grid,i=n.scrollBoundaries(e),r=this.scroller,o=n.rows.frozen?0:r.scrollTop,s=n.columns.frozen?0:r.scrollLeft;return i.top<o&&(t=!0,r.scrollTop=i.scrollTop),i.bottom>o&&(t=!0,r.scrollTop=i.scrollBottom),i.left<s&&(t=!0,r.scrollLeft=i.scrollLeft),i.right>s&&(t=!0,r.scrollLeft=i.scrollRight),t},_destroyDialog:function(){this._dialogs.pop()},openCustomEditor:function(){var e=this,t=e._sheet.activeCell().first(),n=e._sheet.activeCellCustomEditor(),i=e._sheet.range(t);n.edit({range:i,rect:e.activeCellRectangle(),view:this,validation:this._sheet.validation(t),callback:function(t,n){e._executeCommand({command:"EditCommand",options:{property:n?"input":"value",value:t}})}})},openDialog:function(t,n){var i=this._sheet,r=i.activeCell(),o=new e.spreadsheet.Range(r,i),s=e.spreadsheet.dialogs.create(t,n);if(s)return s.bind("action",this._executeCommand.bind(this)),s.bind("deactivate",this._destroyDialog.bind(this)),this._dialogs.push(s),s.open(o),s},showError:function(t,n){var i,r=this.options.messages.errors;e.spreadsheet.dialogs.registered(t.type)?(i={close:n},"validationError"===t.type&&(i=u.extend(i,{title:t.title||"Error",text:t.body?t.body:r[t.type]})),this.openDialog(t.type,i)):this.openDialog("message",{title:t.title||"Error",text:t.body?t.body:r[t.type],activate:function(e){e.sender.dialog().element.find(".k-button").focus()}.bind(this),close:n})},destroy:function(){this._dialogs.forEach(function(e){e.destroy()}),this.cellContextMenu.destroy(),this.rowHeaderContextMenu.destroy(),this.colHeaderContextMenu.destroy(),this.tabstrip&&this.tabstrip.destroy(),this._destroyFilterMenu()},_destroyFilterMenu:function(){this._filterMenu&&(this._filterMenu.destroy(),this._filterMenu=void 0,this._filterMenuColumn=void 0)},render:function(){var t,n,i,r,o,s,a,l,u;this.element.is(":visible")&&(t=this._sheet,n=t.focus(),n&&this.scrollIntoView(n)||(i=t.resizingInProgress()?t.resizeHandlePosition().col===-(1/0)?"column":"row":"none",this.wrapper.toggleClass(f.editContainer,this.editor.isActive()).toggleClass(f.horizontalResize,"row"==i).toggleClass(f.verticalResize,"column"==i),r=t._grid,o=this.scroller.scrollTop,s=this.scroller.scrollLeft,o<0&&(o=0),s<0&&(s=0),a=this.panes.map(function(e){return e.render(s,o)},this),l=[],l=Array.prototype.concat.apply(l,a),u=e.dom.element("div",{style:{width:r._headerWidth+"px",height:r._headerHeight+"px"},className:w.classNames.topCorner}),l.push(u),t.resizeHandlePosition()&&t.resizeHintPosition()&&l.push(this.renderResizeHint()),this.tree.render(l),this.editor.isActive()?this.editor.toggleTooltip(this.activeCellRectangle()):t.selectionInProgress()||t.resizingInProgress()||t.isInEditMode()||this.renderClipboardContents()))},renderResizeHint:function(){var t,n,i=this._sheet,r=i.resizeHandlePosition(),o=r.col!==-(1/0);return t=o?{height:this.scroller.clientHeight+"px",width:d+"px",left:i.resizeHintPosition().x+"px",top:"0px"}:{height:d+"px",width:this.scroller.clientWidth+"px",top:i.resizeHintPosition().y+"px",left:"0px"},n=_.classNames,e.dom.element("div",{className:n.resizeHint+(o?"":" "+n.resizeHintVertical),style:t},[e.dom.element("div",{className:n.resizeHintHandle}),e.dom.element("div",{className:n.resizeHintMarker})])},renderClipboardContents:function(){var e,t,n,i,r=this._sheet,o=r._grid,s=r.select().toRangeRef(),l=this._workbook.clipboard().canCopy();return l.canCopy===!1&&l.multiSelection?(this.clipboardContents.render([]),void this.selectClipBoardContents()):(s=r.trim(s),e=new p,t=o.rangeDimensions(s),t.rows.forEach(function(t){e.addRow(t)}),t.columns.forEach(function(t){e.addColumn(t)}),n={},i={},r.forEachMergedCell(s,function(e){var t=e.topLeft;o.forEach(e,function(r){t.eq(r)?n[r.print()]=e:i[r.print()]=!0})}),r.forEach(s,function(t,r,o){var l,u,h=new c(t,r).print();i[h]||(l=a(e,t-s.topLeft.row,o),u=n[h],u&&(l.attr.colspan=u.width(),l.attr.rowspan=u.height()))}),this.clipboardContents.render([e.toDomTree(0,0,"kendo-clipboard-"+this._workbook.clipboard()._uid)]),void this.selectClipBoardContents())},_pane:function(e,t,n,i){var r=new _(this._sheet,this._sheet._grid.pane({row:e,column:t,rowCount:n,columnCount:i}));return r.refresh(this.scroller.clientWidth,this.scroller.clientHeight),r}}),y={cell:"k-spreadsheet-cell",vaxis:"k-spreadsheet-vaxis",haxis:"k-spreadsheet-haxis",rowHeader:"k-spreadsheet-row-header",columnHeader:"k-spreadsheet-column-header",pane:"k-spreadsheet-pane",data:"k-spreadsheet-data",mergedCell:"k-spreadsheet-merged-cell",mergedCellsWrapper:"k-merged-cells-wrapper",activeCell:"k-spreadsheet-active-cell",selection:"k-spreadsheet-selection",selectionWrapper:"k-selection-wrapper",autoFillWrapper:"k-auto-fill-wrapper",single:"k-single",top:"k-top",right:"k-right",bottom:"k-bottom",left:"k-left",resizeHandle:"k-resize-handle",columnResizeHandle:"k-column-resize-handle",rowResizeHandle:"k-row-resize-handle",resizeHint:"k-resize-hint",resizeHintHandle:"k-resize-hint-handle",resizeHintMarker:"k-resize-hint-marker",resizeHintVertical:"k-resize-hint-vertical",selectionHighlight:"k-spreadsheet-selection-highlight",series:["k-series-a","k-series-b","k-series-c","k-series-d","k-series-e","k-series-f"]},_=e.Class.extend({init:function(e,t){this._sheet=e,this._grid=t},refresh:function(e,t){this._grid.refresh(e,t)},isVisible:function(e,t,n){return this._grid.view(e,t).ref.intersects(n)},render:function(t,n){var i,r,o,s,a,l,u=_.classNames,c=this._sheet,h=this._grid,d=h.view(t,n);return this._currentView=d,this._currentRect=this._rectangle(d.ref),this._selectedHeaders=c.selectedHeaders(),
i=[],i.push(this.renderData()),i.push(this.renderSelection()),i.push(this.renderAutoFill()),i.push(this.renderEditorSelection()),i.push(this.renderFilterHeaders()),h.hasRowHeader&&(r=e.dom.element("div",{className:u.rowHeader,style:{width:h.headerWidth+"px",top:d.rowOffset+"px"}}),i.push(r),c.forEach(d.ref.leftColumn(),function(t){if(!c.isHiddenRow(t)){var n=t+1,i=c.rowHeight(t);r.children.push(e.dom.element("div",{className:this.headerClassName(t,"row"),style:{width:h.headerWidth+"px",height:i+"px"}},[e.dom.element("div",{className:"k-vertical-align-center"},[e.dom.text(n+"")])]))}}.bind(this))),h.hasColumnHeader&&(o=e.dom.element("div",{className:u.columnHeader,style:{top:"0px",left:d.columnOffset+"px",width:this._currentRect.width+"px",height:h.headerHeight+"px"}}),i.push(o),s=0,c.forEach(d.ref.topRow(),function(t,n){if(!c.isHiddenColumn(n)){var i=e.spreadsheet.Ref.display(null,1/0,n),r=c.columnWidth(n);o.children.push(e.dom.element("div",{className:this.headerClassName(n,"col"),style:{position:"absolute",left:s+"px",width:r+"px",height:h.headerHeight+"px"}},[e.dom.element("div",{className:"k-vertical-align-center"},[e.dom.text(i+"")])])),s+=r}}.bind(this))),c.resizeHandlePosition()&&(h.hasColumnHeader||h.hasRowHeader)&&(a=c._grid.normalize(c.resizeHandlePosition()),d.ref.intersects(a)&&(c.resizeHintPosition()||i.push(this.renderResizeHandle()))),l=[u.pane],h.hasColumnHeader&&l.push(u.top),h.hasRowHeader&&l.push(u.left),e.dom.element("div",{style:h.style,className:l.join(" ")},i)},headerClassName:function(e,t){var n,i,r,o=this._selectedHeaders;return"row"===t?(n=o.rows[e],i=o.allRows):(n=o.cols[e],i=o.allCols),r=n||(o.all?"full":i?"partial":"none"),r&&(r="k-selection-"+r),r},renderData:function(){var t,n,i,r=this._sheet,o=this._currentView,a=e.dom.element("div",{className:_.classNames.data,style:{position:"relative",left:o.columnOffset+"px",top:o.rowOffset+"px"}}),l=this._currentRect,u=e.spreadsheet.draw.doLayout(r,o.ref,{forScreen:!0}),c=r._showGridLines;return c&&(t=null,u.xCoords.forEach(function(n){n!==t&&(t=n,a.children.push(e.dom.element("div",{className:y.vaxis,style:{left:n+"px",height:l.height+"px",borderColor:r.gridLinesColor()}})))}),t=null,u.yCoords.forEach(function(n){n!==t&&(t=n,a.children.push(e.dom.element("div",{className:y.haxis,style:{top:n+"px",width:l.width+"px",borderColor:r.gridLinesColor()}})))})),n={},i={},u.cells.forEach(function(e){var t=i[e.col]||(i[e.col]={}),r=n[e.row]||(n[e.row]={});s(a.children,e,null,t,r,c)}),a},renderResizeHandle:function(){var t,n=this._sheet,i=n.resizeHandlePosition(),r=this._rectangle(i),o=[_.classNames.resizeHandle];return i.col!==-(1/0)?(t={height:this._grid.headerHeight+"px",width:d+"px",left:r.right-d/2+"px",top:"0px"},o.push(f.horizontalResize)):(t={height:d+"px",width:this._grid.headerWidth+"px",top:r.bottom-d/2+"px",left:"0px"},o.push(f.verticalResize)),e.dom.element("div",{className:o.join(" "),style:t})},filterIconRect:function(t){var n=16,i=3;return new e.spreadsheet.Rectangle(t.right-n-i,t.top+i,n,n)},renderFilterHeaders:function(){function t(t){return e.dom.element("span",{className:o.icon+" "+t})}function n(n,i,r){var o,a={left:i.left+"px",top:i.top+"px"},l=s&&s.columns.some(function(e){return e.index===r}),u=n.filterButton;return l&&(u+=" "+n.filterButtonActive),o=e.dom.element("span",{className:u,style:a},[t(n.iconFilterDefault)])}var i=this._sheet,r=[],o=w.classNames,s=i.filter();return s&&this._addDiv(r,s.ref,o.filterRange),i.forEachFilterHeader(this._currentView.ref,function(e){var t=this._rectangle(e),i=this.filterIconRect(t),s=this._sheet.filterColumn(e),a=n(o,i,s);r.push(a)}.bind(this)),e.dom.element("div",{className:o.filterHeadersWrapper},r)},renderEditorSelection:function(){var t=_.classNames,n=this._sheet,i=[];return n._formulaSelections.forEach(function(n){var r=n.ref;r!==e.spreadsheet.NULLREF&&this._addDiv(i,r,t.selectionHighlight+" "+n.colorClass)}.bind(this)),e.dom.element("div",{className:t.selectionWrapper},i)},renderSelection:function(){var t=_.classNames,n=[],i=[t.activeCell],r=[t.selection],o=this._sheet,s=o.activeCell().toRangeRef(),a=this._activeFormulaColor(),l=o.select();return i=i.concat(a,this._directionClasses(s)),r=r.concat(a),o.singleCellSelection()&&i.push(t.single),1===l.size()&&r.push("k-single-selection"),this._sheet.autoFillPunch()&&r.push("k-dim-auto-fill-handle"),l.forEach(function(t){t!==e.spreadsheet.NULLREF&&this._addDiv(n,t,r.join(" "))}.bind(this)),this._addTable(n,s,i.join(" ")),e.dom.element("div",{className:t.selectionWrapper},n)},renderAutoFill:function(){var t,n,i,r,o,s,a,l=[];if(this._sheet.autoFillInProgress())if(t=this._sheet.autoFillRef(),n=this._sheet.autoFillPunch(),i=this._sheet._autoFillDirection,this._addDiv(l,t,"k-auto-fill"),n)this._addDiv(l,n,"k-auto-fill-punch");else if(void 0!==i){switch(i){case 0:r=t.bottomRight,o="k-auto-fill-br-hint";break;case 1:r=t.bottomRight,o="k-auto-fill-br-hint";break;case 2:r=new c(t.topLeft.row,t.bottomRight.col),o="k-auto-fill-tr-hint";break;case 3:r=new c(t.bottomRight.row,t.topLeft.col),o="k-auto-fill-bl-hint"}s=e.dom.element("span",{className:"k-tooltip"},[e.dom.text(this._sheet._autoFillHint)]),a=this._addDiv(l,r,o),a&&a.children.push(s)}return e.dom.element("div",{className:_.classNames.autoFillWrapper},l)},_addDiv:function(e,t,n){var i,r=this._currentView;return r.ref.intersects(t)&&(i=this._rectangle(t).resize(1,1).toDiv(n),e.push(i)),i},_addTable:function(t,n,i){var r,o,a=this,l=a._sheet,u=a._currentView;u.ref.intersects(n)&&(r=a._rectangle(n),o=a._sheet.activeCellCustomEditor(),l.forEach(n.collapse(),function(n,a,l){if(l.left=r.left,l.top=r.top,l.width=r.width,l.height=r.height,s(t,l,i,null,null,!0),o){var u=e.dom.element("div",{className:"k-button k-spreadsheet-editor-button",style:{left:l.left+l.width+"px",top:l.top+"px",height:l.height+"px"}});o.icon&&u.children.push(e.dom.element("span",{className:"k-icon "+o.icon})),t.push(u)}}))},_activeFormulaColor:function(){var e,t=[];return this._sheet.isInEditMode()&&(e=this._sheet._formulaSelections.filter(function(e){return e.active&&"ref"==e.type})[0],e&&t.push(e.colorClass)),t},_directionClasses:function(e){var t=[],n=_.classNames,i=this._currentView.ref;return e.move(0,-1).intersects(i)||t.push(n.left),e.move(-1,0).intersects(i)||t.push(n.top),e.move(0,1).intersects(i)||t.push(n.right),e.move(1,0).intersects(i)||t.push(n.bottom),t},_rectangle:function(e){return this._grid.boundingRectangle(e.toRangeRef()).offset(-this._currentView.mergedCellLeft,-this._currentView.mergedCellTop)}}),e.spreadsheet.View=w,e.spreadsheet.Pane=_,e.spreadsheet.drawCell=s,u.extend(!0,w,{classNames:f}),u.extend(!0,_,{classNames:y}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/customeditors.min",["kendo.core.min","kendo.popup.min","kendo.calendar.min","kendo.listview.min","spreadsheet/sheet.min"],e)}(function(){!function(e){"use strict";var t,n;e.support.browser.msie&&e.support.browser.version<9||(t={},n=e.spreadsheet.registerEditor=function(e,n){t[e]=n},e.spreadsheet.Sheet.prototype.activeCellCustomEditor=function(){var e,n,i,r=this.activeCell().first();if(this.range(r).enable())return e=this.validation(r),n=this._properties.get("editor",this._grid.cellRefIndex(r)),null!=n?i=t[n]:e&&e.showButton&&(n="_validation_"+e.dataType,i=t[n]),"function"==typeof i&&(i=t[n]=i()),i},n("_validation_date",function(){function t(){r||(r=$("<div>").kendoCalendar(),o=$("<div>").kendoPopup(),r.appendTo(o),r=r.getKendoCalendar(),o=o.getKendoPopup(),r.bind("change",function(){o.close();var t=r.value();i.range.format()||i.range.format("yyyy-mm-dd"),i.callback(e.spreadsheet.dateToNumber(t))})),o.setOptions({anchor:i.view.element.find(".k-spreadsheet-editor-button")})}function n(){var n,s,a,l;t(),n=i.range.value(),null!=n&&r.value(e.spreadsheet.numberToDate(n)),s=i.validation,s?(a=e.ui.Calendar.fn.options.min,l=e.ui.Calendar.fn.options.max,/^(?:greaterThan|between)/.test(s.comparerType)&&(a=e.spreadsheet.numberToDate(s.from.value)),"between"==s.comparerType&&(l=e.spreadsheet.numberToDate(s.to.value)),"lessThan"==s.comparerType&&(l=e.spreadsheet.numberToDate(s.from.value)),r.setOptions({disableDates:function(t){var n=s.from?0|s.from.value:0,i=s.to?0|s.to.value:0;return t=0|e.spreadsheet.dateToNumber(t),!e.spreadsheet.validation.validationComparers[s.comparerType](t,n,i)},min:a,max:l})):r.setOptions({disableDates:null,min:null,max:null}),o.open()}var i,r,o;return{edit:function(e){i=e,n()},icon:"k-i-calendar"}}),n("_validation_list",function(){function t(){r||(r=$("<div/>").kendoStaticList({template:"<div>#:value#</div>",selectable:!0,autoBind:!1}),o=$("<div>").kendoPopup(),r.appendTo(o),o=o.getKendoPopup(),r=r.getKendoStaticList(),r.bind("change",function(){o.close();var e=r.value()[0];e&&i.callback(e.value)})),o.setOptions({anchor:i.view.element.find(".k-spreadsheet-editor-button")})}function n(){var n,s,a;t(),n=i.validation.from.value,s=[],n&&n.each(function(e){s.push({value:e})}),a=new e.data.DataSource({data:s}),r.setDataSource(a),a.read(),o.open()}var i,r,o;return{edit:function(e){i=e,n()},icon:"k-i-arrow-s"}}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/grid.min",["kendo.core.min","spreadsheet/references.min"],e)}(function(){!function(e){var t,n,i,r,o,s;e.support.browser.msie&&e.support.browser.version<9||(t=e.spreadsheet.CellRef,n=e.spreadsheet.RangeRef,i=e.spreadsheet.UnionRef,r=e.Class.extend({init:function(e,t,n,i){this.left=e,this.width=n,this.right=e+n,this.top=t,this.height=i,this.bottom=t+i},offset:function(e,t){return new r(this.left+e,this.top+t,this.width,this.height)},resize:function(e,t){return new r(this.left,this.top,this.width+e,this.height+t)},intersects:function(e,t){return this.left<e&&e<this.left+this.width&&this.top<t&&t<this.top+this.height},toDiv:function(t){return e.dom.element("div",{className:t,style:{width:this.width+"px",height:this.height+"px",top:this.top+"px",left:this.left+"px"}})}}),o=e.Class.extend({init:function(e,t,n,i,r,o){this.rowCount=n,this.columnCount=i,this._columns=t,this._rows=e,this._headerHeight=r,this._headerWidth=o},isAxis:function(e){var t,n;return e=e.toRangeRef(),t=e.topLeft,n=e.bottomRight,0===t.row&&n.row===this.rowCount-1||0===t.col&&n.col===this.columnCount-1},width:function(e,t){return this._columns.sum(e,t)},height:function(e,t){return this._rows.sum(e,t)},totalHeight:function(){return this._rows.total+this._headerHeight},totalWidth:function(){return this._columns.total+this._headerWidth},index:function(e,t){return t*this.rowCount+e},cellRef:function(e){return new t(e%this.rowCount,e/this.rowCount>>0)},rowRef:function(e){return new n(new t(e,0),new t(e,this.columnCount-1))},colRef:function(e){return new n(new t(0,e),new t(this.rowCount-1,e))},cellRefIndex:function(e){return this.index(e.row,e.col)},normalize:function(e){return e instanceof n?new n(this.normalize(e.topLeft),this.normalize(e.bottomRight)).setSheet(e.sheet,e.hasSheet()):e instanceof i?e.map(function(e){return this.normalize(e)},this):(e instanceof t&&(e=e.clone(),e.col=Math.max(0,Math.min(this.columnCount-1,e.col)),e.row=Math.max(0,Math.min(this.rowCount-1,e.row))),e)},rectangle:function(e){var t=this.normalize(e.topLeft),n=this.normalize(e.bottomRight);return new r(this.width(0,t.col-1),this.height(0,t.row-1),this.width(t.col,n.col),this.height(t.row,n.row))},pane:function(t){return new s(new e.spreadsheet.PaneAxis(this._rows,t.row,t.rowCount,this._headerHeight),new e.spreadsheet.PaneAxis(this._columns,t.column,t.columnCount,this._headerWidth),this)},rangeDimensions:function(e){return{rows:this._rows.values.iterator(e.topLeft.row,e.bottomRight.row),columns:this._columns.values.iterator(e.topLeft.col,e.bottomRight.col)}},forEach:function(e,n){var i,r,o=this.normalize(e.topLeft),s=this.normalize(e.bottomRight);for(i=o.col;i<=s.col;i++)for(r=o.row;r<=s.row;r++)n(new t(r,i))},trim:function(e,i){var r,o,s,a,l,u=e.topLeft,c=e.bottomRight,h=u.row,d=u.col;for(r=u.col;r<=c.col;r++)o=this.index(u.row,r),s=this.index(c.row,r),a=i.tree.intersecting(o,s),a.length&&(l=this.cellRef(a[a.length-1].end),h=Math.max(h,l.row),d=r);return new n(e.topLeft,new t(Math.min(h,e.bottomRight.row),d))}}),s=e.Class.extend({init:function(e,t,n){this.rows=e,this.columns=t,this._grid=n,this.headerHeight=e.headerSize,this.headerWidth=t.headerSize,this.hasRowHeader=t.hasHeader,this.hasColumnHeader=e.hasHeader},refresh:function(e,t){var n,i;this.columns.viewSize(e),this.rows.viewSize(t),n=this.columns.paneSegment(),i=this.rows.paneSegment(),this.left=n.offset,this.top=i.offset,this.right=n.offset+n.length,this.bottom=i.offset+i.length,this.style={top:i.offset+"px",left:n.offset+"px",height:i.length+"px",width:n.length+"px"}},view:function(e,i){var r=this.rows.visible(i),o=this.columns.visible(e);return{rows:r,columns:o,rowOffset:r.offset,columnOffset:o.offset,mergedCellLeft:o.start,mergedCellTop:r.start,ref:new n(new t(r.values.start,o.values.start),new t(r.values.end,o.values.end))}},contains:function(e){return this.rows.contains(e.topLeft.row,e.bottomRight.row)&&this.columns.contains(e.topLeft.col,e.bottomRight.col)},index:function(e,t){return this._grid.index(e,t)},boundingRectangle:function(e){return this._grid.rectangle(e)},cellRefIndex:function(e){return this._grid.cellRefIndex(e)},scrollBoundaries:function(e){var t=this.boundingRectangle(e),n={top:Math.max(0,t.top-this.top+(this.hasColumnHeader?0:this.headerHeight)),left:Math.max(0,t.left-this.left+(this.hasRowHeader?0:this.headerWidth)),right:t.right-this.columns._viewSize+this.headerWidth,bottom:t.bottom-this.rows._viewSize+this.headerHeight},i=this.columns.defaultValue/2,r=this.rows.defaultValue/2;return n.scrollTop=n.top-r,n.scrollBottom=n.bottom+r,n.scrollLeft=n.left-i,n.scrollRight=n.right+i,n}}),e.spreadsheet.Grid=o,e.spreadsheet.PaneGrid=s,e.spreadsheet.Rectangle=r)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/axis.min",["kendo.core.min"],e)}(function(){!function(e){var t,n;e.support.browser.msie&&e.support.browser.version<9||(t=e.Class.extend({init:function(t,n){this._value=n,this._count=t,this.values=new e.spreadsheet.RangeList(0,t-1,n),this._hidden=new e.spreadsheet.RangeList(0,t-1,0),this.scrollBarSize=e.support.scrollbar(),this._refresh()},adjust:function(e,t){t<0?(this.values.copy(e-t,this._count-1,e),this._hidden.copy(e-t,this._count-1,e)):(this.values.copy(e,this._count,e+t),this._hidden.copy(e,this._count,e+t),this.values.value(e,e+t-1,this._value),this._hidden.value(e,e+t-1,0))},toJSON:function(e,t){var n,i,r,o,s=[],a=this.values.iterator(0,this._count-1);for(n=0;n<this._count;n++)i=a.at(n),i!==this._value&&(r=t[n],void 0===r&&(r=s.length,o={index:n},o[e]=i,s.push(o),t[n]=r));return s},fromJSON:function(e,t){var n,i,r;for(n=0;n<t.length;n++)i=t[n][e],r=t[n].index,void 0===r&&(r=n),this.value(r,r,i)},hide:function(e){if(!this.hidden(e)){var t=this.value(e,e);this._hidden.value(e,e,t),this.value(e,e,0)}},hidden:function(e){return 0!==this._hidden.value(e,e)},includesHidden:function(e,t){return this._hidden.intersecting(e,t).length>1},nextVisible:function(e,t){var n,i=this._count-1;return e===i?t?e+1:e:(e+=1,n=this._hidden.intersecting(e,e)[0],0!==n.value?n.end===i?e-1:n.end+1:e)},nextPage:function(e,t){return this.index(this.sum(0,e-1)+t)},prevPage:function(e,t){return this.index(this.sum(0,e)-t)},firstVisible:function(){var e=this._hidden.first();return 0===e.value?0:e.end+1},lastVisible:function(){var e=this._hidden.last();return 0===e.value?this._count-1:e.start-1},prevVisible:function(e,t){if(0===e)return t?-1:0;e-=1;var n=this._hidden.intersecting(e,e)[0];return 0!==n.value?0===n.start?e+1:n.start-1:e},unhide:function(e){if(this.hidden(e)){var t=this._hidden.value(e,e);this._hidden.value(e,e,0),this.value(e,e,t)}},value:function(e,t,n){return void 0===n?this.values.iterator(e,t).at(0):(this.values.value(e,t,n),void this._refresh())},sum:function(e,t){var n,i=this.values.iterator(e,t),r=0;for(n=e;n<=t;n++)r+=i.at(n);return r},visible:function(e,t){var n,i,r,o,s,a,l=null,u=null,c=!1;return t>=this.total+this.scrollBarSize&&(c=!0),n=this._pixelValues.intersecting(e,t),l=n[0],u=n[n.length-1],l?(i=e-l.start,r=(i/l.value.value>>0)+l.value.start,o=i-(r-l.value.start)*l.value.value,s=t-u.start,a=(s/u.value.value>>0)+u.value.start,a>u.value.end&&(a=u.value.end),c&&(o+=u.value.value-(s-(a-u.value.start)*u.value.value)),o=Math.min(-o,0),{values:this.values.iterator(r,a),offset:o}):{values:this.values.iterator(0,0),offset:0}},index:function(e){for(var t=0,n=this.values.iterator(0,this._count-1),i=n.at(0);i<e&&t<this._count-1;)i+=n.at(++t);return t},_refresh:function(){var t=0;this._pixelValues=this.values.map(function(n){var i,r=t;return t+=(n.end-n.start+1)*n.value,i=t-1,new e.spreadsheet.ValueRange(r,i,n)}),this.total=t},getState:function(){return{values:this.values.getState(),hidden:this._hidden.getState()}},setState:function(e){this.values.setState(e.values),this._hidden.setState(e.hidden),this._refresh()}}),n=e.Class.extend({init:function(e,t,n,i){this._axis=e,this._start=t,this._count=n,this.hasHeader=0===t,this.headerSize=i,this.defaultValue=e._value,this.frozen=n>0},viewSize:function(e){this._viewSize=e},sum:function(e,t){return this._axis.sum(e,t-1)},start:function(){return this.sum(0,this._start)},size:function(){return this.sum(this._start,this._start+this._count)},index:function(e,t){return this._axis.index(e+(this.frozen?0:t)-this.headerSize)},paneSegment:function(){var e,t=this.start();return this.hasHeader||(t+=this.headerSize),this.frozen?(e=this.size(),this.hasHeader?e+=this.headerSize:e-=this.headerSize):e=this._viewSize-t,{offset:t,length:e}},visible:function(e){var t,n,i=this.start();return this.frozen?(t=this.size(),this.hasHeader||(t-=this.headerSize)):(t=this._viewSize-i-this.headerSize,i+=e),n=this._axis.visible(i,i+t-1),this.frozen&&(n.offset=0),n.start=i,this.hasHeader&&(n.offset+=this.headerSize,n.start-=this.headerSize),n},contains:function(e,t){return this.frozen?!(e>this._start+this._count)&&!(t<this._start):t>=this._start}}),e.spreadsheet.Axis=t,e.spreadsheet.PaneAxis=n)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/filter.min",["kendo.core.min","kendo.data.min"],e)}(function(){!function(e){function t(e){var t=e.getMonth()+1;return t>=1&&t<=3?1:t>=4&&t<=6?2:t>=7&&t<=9?3:4}function n(t,n){if(t instanceof Date){var i=e.date.today();return i.setFullYear(i.getFullYear()+n),i.getFullYear()===t.getFullYear()}return!1}function i(t,n){if(t instanceof Date){var i=e.date.firstDayOfMonth(e.date.today());return i.setMonth(i.getMonth()+n,1),i.getTime()===e.date.firstDayOfMonth(t).getTime()}return!1}function r(t,n){var i,r;return n instanceof Date&&(i=e.date.dayOfWeek(e.date.getDate(t),1),r=e.date.dayOfWeek(e.date.getDate(n),1),i.getTime()===r.getTime())}if(!(e.support.browser.msie&&e.support.browser.version<9)){var o=e.spreadsheet.Filter=e.Class.extend({prepare:function(){},value:function(e){return e.value},matches:function(){throw Error("The 'matches' method is not implemented.")},toJSON:function(){throw Error("The 'toJSON' method is not implemented.")}});o.create=function(t){var n,i=t.filter;if(!i)throw Error("Filter type not specified.");if(n=e.spreadsheet[i.charAt(0).toUpperCase()+i.substring(1)+"Filter"],!n)throw Error("Filter type not recognized.");return new n(t)},e.spreadsheet.ValueFilter=o.extend({_values:[],_dates:[],_blanks:!1,init:function(e){void 0!==e.values&&(this._values=e.values),void 0!==e.blanks&&(this._blanks=e.blanks),void 0!==e.dates&&(this._dates=e.dates)},value:function(t){var n,i=t.value;return this._dates.length>0&&t.format&&"number"==typeof i&&(n=e.spreadsheet.formatting.type(i,t.format),"date"===n&&(i=e.spreadsheet.numberToDate(i))),i},matches:function(e){return null===e||void 0===e?this._blanks:e instanceof Date?this._dates.some(function(t){return!(t.year!==e.getFullYear()||void 0!==t.month&&t.month!==e.getMonth()||void 0!==t.day&&t.day!==e.getDate()||void 0!==t.hours&&t.hours!==e.getHours()||void 0!==t.minutes&&t.minutes!==e.getMinutes()||void 0!==t.seconds&&t.seconds!==e.getSeconds())}):this._values.indexOf(e)>=0},toJSON:function(){return{filter:"value",values:this._values.slice(0)}}}),e.spreadsheet.CustomFilter=o.extend({_logic:"and",init:function(t){if(void 0!==t.logic&&(this._logic=t.logic),void 0===t.criteria)throw Error("Must specify criteria.");this._criteria=t.criteria;var n=e.data.Query.filterExpr({logic:this._logic,filters:this._criteria}).expression;this._matches=Function("d","return "+n)},matches:function(e){return null!==e&&this._matches(e)},value:function(t){var n=t.value,i=this._criteria[0].value,r=i instanceof Date?"date":typeof i,o=typeof n;return t.format&&(o=e.spreadsheet.formatting.type(n,t.format)),o!=r?"string"==r&&(t.format&&(n=e.spreadsheet.formatting.text(n,t.format)),n+=""):"date"==o&&(n=e.spreadsheet.numberToDate(n)),n},toJSON:function(){return{filter:"custom",logic:this._logic,criteria:this._criteria}}}),e.spreadsheet.TopFilter=o.extend({init:function(e){this._type=e.type,this._value=e.value,this._values=[]},prepare:function(e){var t,n=e.map(this.value).sort().filter(function(e,t,n){return 0===t||e!==n[t-1]});n.sort("topNumber"===this._type||"topPercent"==this._type?function(e,t){return t-e}:function(e,t){return e-t}),t=this._value,"topPercent"!==this._type&&"bottomPercent"!==this._type||(t=n.length*t/100>>0),this._values=n.slice(0,t)},matches:function(e){return this._values.indexOf(e)>=0},toJSON:function(){return{filter:"top",type:this._type,value:this._value}}}),e.spreadsheet.DynamicFilter=o.extend({init:function(e){if(this._type=e.type,this._predicate=this[e.type],"function"!=typeof this._predicate)throw Error("DynamicFilter type '"+e.type+"' not recognized.")},value:function(t){var n,i=t.value;return t.format&&(n=e.spreadsheet.formatting.type(i,t.format),"date"===n&&(i=e.spreadsheet.numberToDate(i))),i},prepare:function(e){var t,n,i=0,r=0;for(t=0;t<e.length;t++)n=this.value(e[t]),"number"==typeof n&&(i+=n,r++);this._average=r>0?i/r:0},matches:function(e){return this._predicate(e)},aboveAverage:function(t){return t instanceof Date&&(t=e.spreadsheet.dateToNumber(t)),"number"==typeof t&&t>this._average},belowAverage:function(t){return t instanceof Date&&(t=e.spreadsheet.dateToNumber(t)),"number"==typeof t&&t<this._average},tomorrow:function(t){if(t instanceof Date){var n=e.date.addDays(e.date.today(),1);return e.date.getDate(t).getTime()===n.getTime()}return!1},today:function(t){return t instanceof Date&&e.date.isToday(t)},yesterday:function(t){if(t instanceof Date){var n=e.date.addDays(e.date.today(),-1);return e.date.getDate(t).getTime()===n.getTime()}return!1},nextWeek:function(t){return r(e.date.addDays(e.date.today(),7),t)},thisWeek:function(t){return r(e.date.today(),t)},lastWeek:function(t){return r(e.date.addDays(e.date.today(),-7),t)},nextMonth:function(e){return i(e,1)},thisMonth:function(e){return i(e,0)},lastMonth:function(e){return i(e,-1)},nextQuarter:function(n){var i,r;return n instanceof Date&&(i=e.date.today(),r=t(n)-t(i),1===r&&i.getFullYear()===n.getFullYear()||r==-3&&i.getFullYear()+1===n.getFullYear())},thisQuarter:function(n){var i,r;return n instanceof Date&&(i=e.date.today(),r=t(n)-t(i),0===r&&i.getFullYear()===n.getFullYear())},lastQuarter:function(n){var i,r;return n instanceof Date&&(i=e.date.today(),r=t(i)-t(n),1===r&&i.getFullYear()===n.getFullYear()||r==-3&&i.getFullYear()-1===n.getFullYear())},nextYear:function(e){return n(e,1)},thisYear:function(e){return n(e,0)},lastYear:function(e){return n(e,-1)},yearToDate:function(t){if(t instanceof Date){var n=e.date.today();return t.getFullYear()===n.getFullYear()&&t<=n}return!1},toJSON:function(){return{filter:"dynamic",type:this._type}}}),[1,2,3,4].forEach(function(n){e.spreadsheet.DynamicFilter.prototype["quarter"+n]=function(e){return e instanceof Date&&t(e)===n}}),e.cultures["en-US"].calendar.months.names.forEach(function(t,n){e.spreadsheet.DynamicFilter.prototype[t.toLowerCase()]=function(e){return e instanceof Date&&e.getMonth()===n}})}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sorter.min",["kendo.core.min"],e)}(function(){!function(e){if(!(e.support.browser.msie&&e.support.browser.version<9)){var t=e.Class.extend({init:function(e,t){this._grid=e,this._lists=t},indices:function(e,n,i,r){var o=t.ascendingComparer;return i===!1&&(o=t.descendingComparer),n.sortedIndices(this._grid.cellRefIndex(e.topLeft),this._grid.cellRefIndex(e.bottomRight),o,r)},sortBy:function(e,t,n,i,r){var o,s,a,l,u=this.indices(e.toColumn(t),n,i,r);for(o=e.topLeft.col;o<=e.bottomRight.col;o++)for(s=this._grid.index(e.topLeft.row,o),a=this._grid.index(e.bottomRight.row,o),l=0;l<this._lists.length;l++)s<this._lists[l].lastRangeStart()&&this._lists[l].sort(s,a,u);return u}});t.ascendingComparer=function(t,n){var i,r;if(null===t&&null===n)return 0;if(null===t)return 1;if(null===n)return-1;if(i=typeof t,r=typeof n,"number"===i)return"number"===r?t-n:-1;if("string"===i)switch(r){case"number":return 1;case"string":return t.localeCompare(n);default:return-1}if("boolean"===i)switch(r){case"number":return 1;case"string":return 1;case"boolean":return t-n;default:return-1}if(t instanceof e.spreadsheet.calc.runtime.CalcError)return n instanceof e.spreadsheet.calc.runtime.CalcError?0:1;throw Error("Cannot compare "+t+" and "+n)},t.descendingComparer=function(e,n){return null===e&&null===n?0:null===e?1:null===n?-1:t.ascendingComparer(n,e)},e.spreadsheet.Sorter=t}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/numformat.min",["spreadsheet/calc.min","kendo.dom.min"],e)}(function(){"use strict";function e(e){function t(){var t=e.skip(c);if(t)return t[1].toLowerCase()}function n(){var t,n=e.skip(h);if(n&&(t=parseFloat(n[2]),!isNaN(t)))return{op:n[1],value:t}}function i(){for(var t,n=[],i=null;!e.eof()&&(t=o());)"date"==t.type?i&&/^(el)?time$/.test(i.type)&&"h"==i.part&&"m"==t.part&&t.format<3&&(t.type="time"):/^(el)?time$/.test(t.type)&&"s"==t.part&&i&&"date"==i.type&&"m"==i.part&&i.format<3&&(i.type="time"),/^(?:str|space|fill)$/.test(t.type)||(i=t),n.push(t);return n}function r(t){if("date"!=t.type||"m"==t.part&&t.format<3){var n=e.skip(/^\.(0+)/);n&&(t.fraction=n[1].length,"date"==t.type&&(t.type="time"))}return t}function o(){var t,n;if(n=e.skip(/^([#0?]+)(?:,([#0?]+))+/))return{type:"digit",sep:!0,format:n[1]+n[2],decimal:d};if(n=e.skip(/^[#0?]+/))return{type:"digit",sep:!1,format:n[0],decimal:d};if(n=e.skip(/^(e)([+-])/i))return{type:"exp",ch:n[1],sign:n[2]};if(n=e.skip(/^(d{1,4}|m{1,5}|yyyy|yy)/i))return n=n[1].toLowerCase(),r({type:"date",part:n.charAt(0),format:n.length});if(n=e.skip(/^(hh?|ss?)/i))return n=n[1].toLowerCase(),r({type:"time",part:n.charAt(0),format:n.length});if(n=e.skip(/^\[(hh?|mm?|ss?)\]/i))return n=n[1].toLowerCase(),r({type:"eltime",part:n.charAt(0),format:n.length});if(n=e.skip(/^(am\/pm|a\/p)/i))return n=n[1].split("/"),{type:"ampm",am:n[0],pm:n[1]};switch(t=e.next()){case";":return null;case"\\":return{type:"str",value:e.next()};case'"':return{type:"str",value:e.readEscaped(t)};case"@":return{type:"text"};case"_":return{type:"space",value:e.next()};case"*":return{type:"fill",value:e.next()};case".":return e.lookingAt(/^\s*[#0?]/)?(d=!0,{type:"dec"}):{type:"str",value:"."};case"%":return{type:"percent"};case",":return{type:"comma"}}return{type:"str",value:t}}function s(){d=!1;var e=t(),r=n();return!e&&r&&(e=t()),{color:e,cond:r,body:i()}}var a,u,d,f;for(e=l.InputStream(e),a=[],u=!1;!e.eof();)f=s(),a.push(f),f.cond&&(u=!0);return u||(1==a.length?a[0].cond="num":2==a.length?(a[0].cond={op:">=",value:0},a[1].cond={op:"<",value:0}):a.length>=3&&(a[0].cond={op:">",value:0},a[1].cond={op:"<",value:0},a[2].cond={op:"=",value:0},a.length>3&&(a[3].cond="text",a=a.slice(0,4)))),a}function t(e){function t(e){var t="";return e.color&&(t+="["+e.color+"]"),e.cond&&"text"!=e.cond&&"num"!=e.cond&&(t+="["+e.cond.op+e.cond.value+"]"),t+=e.body.map(i).join("")}function n(e,t){return t.fraction&&(e+="."+s("",t.fraction,"0")),e}function i(e){return"digit"==e.type?e.sep?e.format.charAt(0)+","+e.format.substr(1):e.format:"exp"==e.type?e.ch+e.sign:"date"==e.type||"time"==e.type?n(s("",e.format,e.part),e):"eltime"==e.type?n("["+s("",e.format,e.part)+"]",e):"ampm"==e.type?e.am+"/"+e.pm:"str"==e.type?JSON.stringify(e.value):"text"==e.type?"@":"space"==e.type?"_"+e.value:"fill"==e.type?"*"+e.value:"dec"==e.type?".":"percent"==e.type?"%":"comma"==e.type?",":void 0}return e.map(t).join(";")}function n(e,t){e.forEach(function(e){var n,i,r,o,a,l=t;if("text"!=e.cond){for(n=e.body,i=!1,r=n.length;0!==l&&--r>=0;)if(o=n[r],"digit"==o.type){if(o.decimal&&(i=!0,l>0?o.format+=s("",l,"0"):l<0&&(a=o.format.length,o.format=o.format.substr(0,a+l),l+=a-o.format.length),0===o.format.length))for(n.splice(r,1);--r>=0;){if(o=n[r],"digit"==o.type&&o.decimal){++r;break}if("dec"==o.type){n.splice(r,1);break}}if(l>0)break}!i&&l>0&&n.splice(r+1,0,{type:"dec"},{type:"digit",sep:!1,decimal:!0,format:s("",l,"0")})}})}function i(e){var t=0;return{next:function(){return e[t++]},eof:function(){return t>=e.length},ahead:function(n,i){if(t+n<=e.length){var r=i.apply(null,e.slice(t,t+n));return r&&(t+=n),r}},restart:function(){t=0}}}function r(e){function t(e,t){("digit"==e.type&&"comma"==t.type||"comma"==e.type&&e.hidden&&"comma"==t.type)&&(t.hidden=!0,c++)}var n,r,o=i(e.body),s=!1,a=!1,l=!1,u=0,c=0,h="",d=!1,f=0,p=[],m=[],g=e.cond,v="";for("text"==g?v="if (typeof value == 'string' || value instanceof kendo.spreadsheet.CalcError) { ":"num"==g?v="if (typeof value == 'number') { ":g&&(n="="==g.op?"==":g.op,v="if (typeof value == 'number' && value "+n+" "+g.value+") { ",h+="value = Math.abs(value); "),e.color&&(h+="result.color = "+JSON.stringify(e.color)+"; ");!o.eof();)o.ahead(2,t),r=o.next(),"percent"==r.type?u++:"digit"==r.type?r.decimal?(f+=r.format.length,m.push(r.format)):(p.push(r.format),r.sep&&(d=!0)):"time"==r.type?a=!0:"date"==r.type?s=!0:"ampm"==r.type&&(l=a=!0);for(u>0&&(h+="value *= "+Math.pow(100,u)+"; "),c>0&&(h+="value /= "+Math.pow(1e3,c)+"; "),p.length&&(h+="var intPart = runtime.formatInt(culture, value, "+JSON.stringify(p)+", "+f+", "+d+"); "),m.length&&(h+="var decPart = runtime.formatDec(value, "+JSON.stringify(m)+", "+f+"); "),(p.length||m.length)&&(h+="type = 'number'; "),s&&(h+="var date = runtime.unpackDate(value); "),a&&(h+="var time = runtime.unpackTime(value); "),(s||a)&&(h+="type = 'date'; "),(u>0||c>0||p.length||m.length||s||a)&&(v||(v="if (typeof value == 'number') { ")),o.restart();!o.eof();)r=o.next(),"dec"==r.type?h+="output += culture.numberFormat['.']; ":"comma"!=r.type||r.hidden?"percent"==r.type?(h+="type = 'percent'; ",h+="output += culture.numberFormat.percent.symbol; "):"str"==r.type?h+="output += "+JSON.stringify(r.value)+"; ":"text"==r.type?(h+="type = 'text'; ",h+="output += value; "):"space"==r.type?(h+="if (output) result.body.push(output); ",h+="output = ''; ",h+="result.body.push({ type: 'space', value: "+JSON.stringify(r.value)+" }); "):"fill"==r.type?h+="output += runtime.fill("+JSON.stringify(r.value)+"); ":"digit"==r.type?h+="output += "+(r.decimal?"decPart":"intPart")+".shift(); ":"date"==r.type?h+="output += runtime.date(culture, date, "+JSON.stringify(r.part)+", "+r.format+"); ":"time"==r.type?h+="output += runtime.time(time, "+JSON.stringify(r.part)+", "+r.format+", "+l+", "+r.fraction+"); ":"eltime"==r.type?h+="output += runtime.eltime(value, "+JSON.stringify(r.part)+", "+r.format+", "+r.fraction+"); ":"ampm"==r.type&&(h+="output += time.hours < 12 ? "+JSON.stringify(r.am)+" : "+JSON.stringify(r.pm)+"; "):h+="output += ','; ";return h+="if (output) result.body.push(output); ",h+="result.type = type; ",h+="return result; ",v&&(h=v+h+"}"),h}function o(t){var n,i,o=d[t];return o||(n=e(t),i=n.map(r),i.push(f),i=i.join("\n"),i="'use strict'; return function(value, culture){ if (!culture) culture = kendo.culture(); var output = '', type = null, result = { body: [] }; "+i+"; return result; };",
o=d[t]=Function("runtime",i)(p)),o}function s(e,t,n){for(e+="";e.length<t;)e=n+e;return e}function a(e){var t,n,i=e.body,r="";for(t=0;t<i.length;++t)n=i[t],"string"==typeof n?r+=n:"space"==n.type&&(r+=" ");return r}var l,u,c,h,d,f,p;kendo.support.browser.msie&&kendo.support.browser.version<9||(l=kendo.spreadsheet.calc,u=kendo.dom,c=/^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i,h=/^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/,d=Object.create(null),f=r({cond:"text",body:[{type:"text"}]}),p={unpackDate:l.runtime.unpackDate,unpackTime:l.runtime.unpackTime,date:function(e,t,n,i){switch(n){case"d":switch(i){case 1:return t.date;case 2:return s(t.date,2,"0");case 3:return e.calendars.standard.days.namesAbbr[t.day];case 4:return e.calendars.standard.days.names[t.day]}break;case"m":switch(i){case 1:return t.month+1;case 2:return s(t.month+1,2,"0");case 3:return e.calendars.standard.months.namesAbbr[t.month];case 4:return e.calendars.standard.months.names[t.month];case 5:return e.calendars.standard.months.names[t.month].charAt(0)}break;case"y":switch(i){case 2:return t.year%100;case 4:return t.year}}return"##"},time:function(e,t,n,i,r){var o,a;switch(t){case"h":o=s(i?e.hours%12||12:e.hours,n,"0"),r&&(a=(e.minutes+(e.seconds+e.milliseconds/1e3)/60)/60);break;case"m":o=s(e.minutes,n,"0"),r&&(a=(e.seconds+e.milliseconds/1e3)/60);break;case"s":o=s(e.seconds,n,"0"),r&&(a=e.milliseconds/1e3)}return a&&(o+=a.toFixed(r).replace(/^0+/,"")),o},eltime:function(e,t,n,i){var r,o;switch(t){case"h":r=24*e;break;case"m":r=24*e*60;break;case"s":r=24*e*60*60}return i&&(o=r-(0|r)),r=s(0|r,n,"0"),o&&(r+=o.toFixed(i).replace(/^0+/,"")),r},fill:function(e){return e},formatInt:function(e,t,n,i,r){function o(t){r&&l&&l%3===0&&/^[0-9]$/.test(t)&&(u=e.numberFormat[","]+u),u=t+u,l++}var s,a,l,u,c,h,d,f;for(t=t.toFixed(i).replace(/\..*$/,""),i>0&&("0"===t?t="":"-0"===t&&(t="-")),s=t.length-1,a=[],l=0,c=n.length;--c>=0;){for(h=n[c],u="",d=h.length;--d>=0;)f=h.charAt(d),s<0?"0"==f?o("0"):"?"==f&&o(" "):o(t.charAt(s--));if(0===c)for(;s>=0;)o(t.charAt(s--));a.unshift(u)}return a},formatDec:function(e,t,n){var i,r,o,s,a,l,u,c;for(e=e.toFixed(n),i=e.indexOf("."),e=i>=0?e.substr(i+1).replace(/0+$/,""):"",r=0,o=[],s=0;s<t.length;++s){for(a=t[s],l="",u=0;u<a.length;++u)c=a.charAt(u),r<e.length?l+=e.charAt(r++):"0"==c?l+="0":"?"==c&&(l+=" ");o.push(l)}return o}},kendo.spreadsheet.formatting={compile:o,parse:e,format:function(e,t,n){var i,r,s,a=o(t)(e,n),l=u.element("span");for(l.__dataType=a.type,i=a.body,a.color&&(l.attr.style={color:a.color}),r=0;r<i.length;++r)s=i[r],"string"==typeof s?l.children.push(u.text(s)):"space"==s.type&&l.children.push(u.element("span",{style:{visibility:"hidden"}},[u.text(s.value)]));return l},text:function(e,t,n){var i=o(t)(e,n);return a(i)},textAndColor:function(e,t,n){var i=o(t)(e,n);return{text:a(i),color:i.color,type:i.type}},type:function(e,t){return o(t)(e).type},adjustDecimals:function(i,r){var o=e(i);return n(o,r),t(o)}})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.functions.min",["spreadsheet/runtime.min","util/main.min"],e)}(function(){"use strict";function e(e){return(Math.exp(e)+Math.exp(-e))/2}function t(e){return(Math.exp(e)-Math.exp(-e))/2}function n(n){return t(n)/e(n)}function i(e,t){for(;t;){var n=e%t;e=t,t=n}return e}function r(e,t){return Math.abs(e*t)/i(e,t)}function o(e,t){for(var n,i,r,o=[],s=0,a=e[0];s<e.length;)o.push({matrix:e[s++],pred:j(e[s++])});for(n=0;n<a.height;++n)e:for(i=0;i<a.width;++i){for(s=0;s<o.length;++s)if(r=o[s].matrix.get(n,i),!o[s].pred(null==r||""===r?0:r))continue e;t(n,i)}}function s(e){return e.reduce(function(e,t){return e+t},0)/e.length}function a(e,t,n){return null==n&&(n=s(e)),e.reduce(function(e,t){return e+Math.pow(t-n,2)},0)/t}function l(e,t){return Math.sqrt(a(e,t))}function u(e,t,n){var i=0,r=0,o=null,s=null,a=!1;return e.forEach(function(e){e<t?(i++,o=null==o?e:Math.max(o,e)):e>t?(r++,s=null==s?e:Math.min(s,e)):a=!0}),i||r?a?n?(i+1)/(e.length+1):i/(i+r):((s-t)*u(e,o,n)+(t-o)*u(e,s,n))/(s-o):new E("N/A")}function c(e,t,n){var i,r=0,o=s(e),a=s(t),l=e.length;for(i=0;i<l;++i)r+=(e[i]-o)*(t[i]-a);return r/n}function h(e,t){var n,i,r;return e.sort(y),n=e.length,i=0|t,r=t-i,0===i?e[0]:i>=n?e[n-1]:(--i,e[i]+r*(e[i+1]-e[i]))}function d(e,t){var n=t*(e.length-1)+1;return h(e,n)}function f(e,t){var n=t*(e.length+1);return h(e,n)}function p(e,t,n){var i=[],r=1,o=2,s=4;return function a(t){if(t instanceof B)e.getRefCells(t,!0).forEach(function(e){var t,a=e.value;if(!(n&r&&e.hidden)){if(e.formula){if(t=e.formula.print(e.row,e.col),/^\s*(?:aggregate|subtotal)\s*\(/i.test(t)&&!(n&s))return;"value"in e.formula&&(a=e.formula.value)}n&o&&a instanceof E||("number"==typeof a||a instanceof E)&&i.push(a)}});else if(Array.isArray(t))for(var l=0;l<t.length;++l)a(t[l]);else t instanceof T?t.each(a):"number"==typeof t?i.push(t):t instanceof E&&!(n&o)&&i.push(t)}(t),i}function m(e,t,n,i){var r,o;if(i){for(r=0,o=0;o<=e;++o)r+=U(t,o)*Math.pow(n,o)*Math.pow(1-n,t-o);return r}return U(t,e)*Math.pow(n,e)*Math.pow(1-n,t-e)}function g(e){var t=I(N(e,0,1));return 4==t.day||3==t.day&&F.isLeapYear(e)?53:52}function v(e,t,n){var i=I(e),r=I(t);return n?(31==i.date&&(i.date=30),31==r.date&&(r.date=30)):(1==i.month&&1==r.month&&i.date==L(i.year,1)&&r.date==L(r.year,1)&&(r.date=30),i.date==L(i.year,i.month)?(i.date=30,31==r.date&&(r.date=30)):30==i.date&&31==r.date&&(r.date=30)),360*(r.year-i.year)+30*(r.month-i.month)+(r.date-i.date)}function b(e,t){this.link=e,this.text=t}function w(e){return"number"==typeof e||"boolean"==typeof e||null==e||""===e}function y(e,t){return e===t?0:e<t?-1:1}function _(e,t){return e===t?0:e<t?1:-1}var k,x,C,F,R,S,E,A,M,D,T,B,L,N,I,z,P,H,$,V,O,U,q,W,j;kendo.support.browser.msie&&kendo.support.browser.version<9||(k=kendo.util,x=kendo.spreadsheet,C=x.calc,F=C.runtime,R=F.defineFunction,S=F.defineAlias,E=F.CalcError,A=x.RangeRef,M=x.CellRef,D=x.UnionRef,T=F.Matrix,B=x.Ref,L=F.daysInMonth,N=F.packDate,I=F.unpackDate,z=F.daysInYear,["abs","cos","sin","acos","asin","tan","atan","exp","sqrt"].forEach(function(e){R(e,Math[e]).args([["*n","number"]])}),R("ln",Math.log).args([["*n","number"]]),R("log",function(e,t){return Math.log(e)/Math.log(t)}).args([["*num","number++"],["*base",["or","number++",["null",10]]],["?",["assert","$base != 1","DIV/0"]]]),R("log10",function(e){return Math.log(e)/Math.log(10)}).args([["*num","number++"]]),R("pi",function(){return Math.PI}).args([]),R("sqrtpi",function(e){return Math.sqrt(e*Math.PI)}).args([["*num","number+"]]),R("degrees",function(e){return 180*e/Math.PI%360}).args([["*radians","number"]]),R("radians",function(e){return Math.PI*e/180}).args([["*degrees","number"]]),R("cosh",e).args([["*num","number"]]),R("acosh",function(e){return Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1))}).args([["*num","number"],["?",["assert","$num >= 1"]]]),R("sinh",t).args([["*num","number"]]),R("asinh",function(e){return Math.log(e+Math.sqrt(e*e+1))}).args([["*num","number"]]),R("sec",function(e){return 1/Math.cos(e)}).args([["*num","number"]]),R("sech",function(t){return 1/e(t)}).args([["*num","number"]]),R("csc",function(e){return 1/Math.sin(e)}).args([["*num","number"]]),R("csch",function(e){return 1/t(e)}).args([["*num","number"]]),R("atan2",function(e,t){return Math.atan(t/e)}).args([["*x","divisor"],["*y","number"]]),R("tanh",n).args([["*num","number"]]),R("atanh",function(e){return Math.log(Math.sqrt(1-e*e)/(1-e))}).args([["*num",["and","number",["(between)",-1,1]]]]),R("cot",function(e){return 1/Math.tan(e)}).args([["*num","divisor"]]),R("coth",function(e){return 1/n(e)}).args([["*num","divisor"]]),R("acot",function(e){return Math.PI/2-Math.atan(e)}).args([["*num","number"]]),R("acoth",function(e){return Math.log((e+1)/(e-1))/2}).args([["*num","number"],["?",["or",["assert","$num < -1"],["assert","$num > 1"]]]]),R("power",function(e,t){return Math.pow(e,t)}).args([["*a","number"],["*b","number"]]),R("mod",function(e,t){return e%t}).args([["*a","number"],["*b","divisor"]]),R("quotient",function(e,t){return Math.floor(e/t)}).args([["*a","number"],["*b","divisor"]]),R("ceiling",function(e,t){return t?t*Math.ceil(e/t):0}).args([["*number","number"],["*significance","number"],["?",["assert","$significance >= 0 || $number < 0"]]]),R("ceiling.precise",function(e,t){return t=Math.abs(t),t?t*Math.ceil(e/t):0}).args([["*number","number"],["*significance",["or","number",["null",1]]]]),S("iso.ceiling","ceiling.precise"),R("ceiling.math",function(e,t,n){return t&&e?(e<0&&(!n&&t<0||n&&t>0)&&(t=-t),t?t*Math.ceil(e/t):0):0}).args([["*number","number"],["*significance",["or","number",["null","$number < 0 ? -1 : 1"]]],["*mode",["or","logical",["null",0]]]]),R("floor",function(e,t){return t?t*Math.floor(e/t):0}).args([["*number","number"],["*significance","number"],["?",["assert","$significance >= 0 || $number < 0"]]]),R("floor.precise",function(e,t){return t=Math.abs(t),t?t*Math.floor(e/t):0}).args([["*number","number"],["*significance",["or","number",["null",1]]]]),R("floor.math",function(e,t,n){return t&&e?(e<0&&(!n&&t<0||n&&t>0)&&(t=-t),t?t*Math.floor(e/t):0):0}).args([["*number","number"],["*significance",["or","number",["null","$number < 0 ? -1 : 1"]]],["*mode",["or","logical",["null",0]]]]),R("int",Math.floor).args([["*number","number"]]),R("mround",function(e,t){return t?t*Math.round(e/t):0}).args([["*number","number"],["*multiple","number"]]),R("round",function(e,t){var n=e<0?-1:1;return n<0&&(e=-e),t=Math.pow(10,t),e*=t,e=Math.round(e),n*e/t}).args([["*number","number"],["*digits","number"]]),R("roundup",function(e,t){return t=Math.pow(10,t),e*=t,e=e<0?Math.floor(e):Math.ceil(e),e/t}).args([["*number","number"],["*digits","number"]]),R("rounddown",function(e,t){return t=Math.pow(10,t),e*=t,e=e<0?Math.ceil(e):Math.floor(e),e/t}).args([["*number","number"],["*digits","number"]]),R("even",function(e){var t=e<0?Math.floor(e):Math.ceil(e);return t%2?t+(t<0?-1:1):t}).args([["*number","number"]]),R("odd",function(e){var t=e<0?Math.floor(e):Math.ceil(e);return t%2?t:t+(t<0?-1:1)}).args([["*number","number"]]),R("sign",function(e){return e<0?-1:e>0?1:0}).args([["*number","number"]]),R("gcd",function(e){var t,n=e[0];for(t=1;t<e.length;++t)n=i(n,e[t]);return n}).args([["numbers",["collect","number"]]]),R("lcm",function(e){var t,n=e[0];for(t=1;t<e.length;++t)n=r(n,e[t]);return n}).args([["numbers",["collect","number"]]]),R("sum",function(e){return e.reduce(function(e,t){return e+t},0)}).args([["numbers",["collect","number"]]]),R("product",function(e){return e.reduce(function(e,t){return e*t},1)}).args([["numbers",["collect","number"]]]),R("sumproduct",function(e,t){var n=0;return e.each(function(e,i,r){var o,s;if("number"==typeof e){for(o=0;o<t.length;++o){if(s=t[o].get(i,r),"number"!=typeof s)return;e*=s}n+=e}}),n}).args([["a1","matrix"],["+",["a2",["and","matrix",["assert","$a2.width == $a1.width"],["assert","$a2.height == $a1.height"]]]]]),R("sumsq",function(e){return e.reduce(function(e,t){return e+t*t},0)}).args([["numbers",["collect","number"]]]),R("sumx2my2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=e*e-o*o)}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),R("sumx2py2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=e*e+o*o)}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),R("sumxmy2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=(e-o)*(e-o))}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),R("seriessum",function(e,t,n,i){var r=0;return i.each(function(i){if("number"!=typeof i)throw new E("VALUE");r+=i*Math.pow(e,t),t+=n}),r}).args([["x","number"],["y","number"],["m","number"],["a","matrix"]]),R("min",function(e){return Math.min.apply(Math,e)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),R("max",function(e){return Math.max.apply(Math,e)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),R("counta",function(e){return e.length}).args([["values",["#collect","anyvalue"]]]),R("count",function(e){return e.length}).args([["numbers",["#collect","number"]]]),R("countunique",function(e){var t=0,n=[];return e.forEach(function(e){n.indexOf(e)<0&&(t++,n.push(e))}),t}).args([["values",["#collect","anyvalue"]]]),R("countblank",function(e){function t(e){null!=e&&""!==e||i++}function n(e){var n,i;for(n=0;n<e.length;++n)i=e[n],i instanceof T?i.each(t,!0):t(i)}var i=0;return n(e),i}).args([["+",["args",["or","matrix","anyvalue"]]]]),R("iseven",function(e){return e%2===0}).args([["*number","number"]]),R("isodd",function(e){return e%2!==0}).args([["*number","number"]]),R("n",function(e){return"boolean"==typeof e?e?1:0:"number"==typeof e?e:0}).args([["*value","anyvalue"]]),R("na",function(){return new E("N/A")}).args([]),P=[["m1","matrix"],["c1","anyvalue"],[["m2","matrix"],["c2","anyvalue"]]],R("countifs",function(e,t,n){var i=0;return n.unshift(e,t),o(n,function(){i++}),i}).args(P),H=[["range","matrix"]].concat(P),R("sumifs",function(e,t,n,i){i.unshift(e,w,t,n);var r=0;return o(i,function(t,n){var i=e.get(t,n);i&&(r+=i)}),r}).args(H),R("averageifs",function(e,t,n,i){i.unshift(e,w,t,n);var r=0,s=0;return o(i,function(t,n){var i=e.get(t,n);null!=i&&""!==i||(i=0),r+=i,s++}),s?r/s:new E("DIV/0")}).args(H),R("countif",function(e,t){t=j(t);var n=0;return e.each(function(e){t(e)&&n++}),n}).args([["range","matrix"],["*criteria","anyvalue"]]),$=[["range","matrix"],["*criteria","anyvalue"],["sumRange",["or",["and","matrix",["assert","$sumRange.width == $range.width"],["assert","$sumRange.height == $range.height"]],["null","$range"]]]],R("sumif",function(e,t,n){var i=0;return t=j(t),e.each(function(e,r,o){if(t(e)){var s=n.get(r,o);w(s)&&(i+=s||0)}}),i}).args($),R("averageif",function(e,t,n){var i=0,r=0;return t=j(t),e.each(function(e,o,s){if(t(e)){var a=n.get(o,s);w(a)&&(i+=a||0,r++)}}),r?i/r:new E("DIV/0")}).args($),function(e){e("large",function(e,t){return e.sort(_)[t]}),e("small",function(e,t){return e.sort(y)[t]})}(function(e,t){R(e,function(e,n){var i=[],r=e.each(function(e){return e instanceof E?e:void("number"==typeof e&&i.push(e))});return r?r:n>i.length?new E("NUM"):t(i,n-1)}).args([["array","matrix"],["*nth","number++"]])}),R("stdev.s",function(e){return l(e,e.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),R("stdev.p",function(e){return l(e,e.length)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),R("var.s",function(e){return a(e,e.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),R("var.p",function(e){return a(e,e.length)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),R("median",function(e){var t=e.length;return e.sort(y),t%2?e[t>>1]:(e[t>>1]+e[t>>2])/2}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),R("mode.sngl",function(e){var t,n,i,r,o,s;for(e.sort(y),t=null,n=0,i=1,r=null,o=0;o<e.length;++o)s=e[o],s!=t?(n=1,t=s):n++,n>i&&(i=n,r=s);return null==r?new E("N/A"):r}).args([["numbers",["collect","number"]]]),R("mode.mult",function(e){var t,n=Object.create(null),i=2,r=[];return e.forEach(function(e){var t=n[e]||0;n[e]=++t,t==i?r.push(e):t>i&&(i=t,r=[e])}),t=new T(this),r.forEach(function(e,n){t.set(n,0,e)}),t}).args([["numbers",["collect","number"]]]),R("geomean",function(e){var t=e.length,n=e.reduce(function(e,t){if(t<0)throw new E("NUM");return e*t},1);return Math.pow(n,1/t)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","NUM"]]]),R("harmean",function(e){var t=e.length,n=e.reduce(function(e,t){if(!t)throw new E("DIV/0");return e+1/t},0);return t/n}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","NUM"]]]),R("trimmean",function(e,t){var n,i,r,o=e.length;for(e.sort(y),n=Math.floor(o*t),n%2&&--n,n/=2,i=0,r=n;r<o-n;++r)i+=e[r];return i/(o-2*n)}).args([["numbers",["collect","number",1]],["percent",["and","number",["[between)",0,1]]],["?",["assert","$numbers.length > 0","NUM"]]]),R("frequency",function(e,t){function n(t){for(var n=0;r<e.length&&e[r]>i&&e[r]<=t;)++n,++r;return n}var i,r,o;return e.sort(y),t.sort(y),i=-(1/0),r=0,o=new T(this),t.forEach(function(e,t){var r=n(e);i=e,o.set(t,0,r)}),o.set(o.height,0,e.length-r),o}).args([["data",["collect","number",1]],["bins",["collect","number",1]]]),R("rank.eq",function(e,t,n){t.sort(n?y:_);var i=t.indexOf(e);return i<0?new E("N/A"):i+1}).args([["value","number"],["numbers",["collect","number"]],["order",["or","logical",["null",!1]]]]),S("rank","rank.eq"),R("rank.avg",function(e,t,n){var i,r;if(t.sort(n?y:_),i=t.indexOf(e),i<0)return new E("N/A");for(r=i;t[r]==e;++r);return(i+r+1)/2}).args([["value","number"],["numbers",["collect","number"]],["order",["or","logical",["null",!1]]]]),R("kurt",function(e){var t=e.length,n=s(e),i=a(e,t-1,n),r=Math.sqrt(i),o=e.reduce(function(e,t){return e+Math.pow((t-n)/r,4)},0);return t*(t+1)/((t-1)*(t-2)*(t-3))*o-3*Math.pow(t-1,2)/((t-2)*(t-3))}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 4","NUM"]]]),V=[["array",["collect","number",1]],["x","number"],["significance",["or",["null",3],"integer++"]],["?",["assert","$array.length > 0","NUM"]]],R("percentrank.inc",function(e,t,n){var i=u(e,t,0);return i=i.toFixed(n+1),parseFloat(i.substr(0,i.length-1))}).args(V),R("percentrank.exc",function(e,t,n){var i=u(e,t,1);return i=i.toFixed(n+1),parseFloat(i.substr(0,i.length-1))}).args(V),S("percentrank","percentrank.inc"),R("covariance.p",function(e,t){return c(e,t,e.length)}).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length == $array2.length","N/A"]],["?",["assert","$array1.length > 0","DIV/0"]]]),R("covariance.s",function(e,t){return c(e,t,e.length-1)}).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length == $array2.length","N/A"]],["?",["assert","$array1.length > 1","DIV/0"]]]),S("covar","covariance.p"),O=k.memoize(function(e){for(var t=2,n=1;t<=e;++t)n*=t;return n}),R("fact",O).args([["*n","integer+"]]),R("factdouble",function(e){for(var t=2+(1&e),n=1;t<=e;t+=2)n*=t;return n}).args([["*n","integer+"]]),R("multinomial",function(e){var t=1,n=0;return e.forEach(function(e){if(e<0)throw new E("NUM");n+=e,t*=O(e)}),O(n)/t}).args([["numbers",["collect","number"]]]),U=k.memoize(function(e,t){for(var n=t+1,i=1,r=1,o=1;i<=e-t;++n,++i)r*=n,o*=i;return r/o}),R("combin",U).args([["*n","integer++"],["*k",["and","integer",["[between]",0,"$n"]]]]),R("combina",function(e,t){return U(e+t-1,e-1)}).args([["*n","integer++"],["*k",["and","integer",["[between]",1,"$n"]]]]),R("average",function(e){var t=e.reduce(function(e,t){return e+t},0);return t/e.length}).args([["numbers",["collect",["and","number",["not","boolean"]]]],["?",["assert","$numbers.length > 0","DIV/0"]]]),R("averagea",function(e){var t=0,n=0;return e.forEach(function(e){"string"!=typeof e&&(t+=e),++n}),n?t/n:new E("DIV/0")}).args([["values",["collect","anyvalue"]]]),R("percentile.inc",d).args([["numbers",["collect","number",1]],["p",["and","number",["[between]",0,1]]]]),R("percentile.exc",f).args([["numbers",["collect","number",1]],["p",["and","number",["(between)",0,1]]]]),R("quartile.inc",function(e,t){return d(e,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]),R("quartile.exc",function(e,t){return f(e,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]),S("quartile","quartile.inc"),S("percentile","percentile.inc"),q=["AVERAGE","COUNT","COUNTA","MAX","MIN","PRODUCT","STDEV.S","STDEV.P","SUM","VAR.S","VAR.P","MEDIAN","MODE.SNGL","LARGE","SMALL","PERCENTILE.INC","QUARTILE.INC","PERCENTILE.EXC","QUARTILE.EXC"],R("aggregate",function(e,t,n,i){var r=this;r.resolveCells(i,function(){var o,s;if(t>12){if(o=p(r,i[0],n),s=i[1],s instanceof M&&(s=r.getRefData(s)),"number"!=typeof s)return e(new E("VALUE"))}else o=p(r,i,n);r.func(q[t-1],e,o)})}).argsAsync([["funcId",["values",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]],["options",["or",["null",0],["values",0,1,2,3,4,5,6,7]]],["args","rest"]]),R("subtotal",function(e,t){var n,i,r=this,o=t>100;for(o&&(t-=100),n=[],i=2;i<arguments.length;++i)n.push(arguments[i]);r.resolveCells(n,function(){var i=p(r,n,o?1:0);r.func(q[t-1],e,i)})}).argsAsync([["funcId",["values",1,2,3,4,5,6,7,8,9,10,11,101,102,103,104,105,106,107,108,109,110,111]],["+",["ref",["or","ref","#matrix"]]]]),R("avedev",function(e){var t=e.reduce(function(e,t){return e+t},0)/e.length;return e.reduce(function(e,n){return e+Math.abs(n-t)},0)/e.length}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),R("binom.dist",m).args([["successes","integer+"],["trials",["and","integer",["assert","$trials >= $successes"]]],["probability",["and","number",["[between]",0,1]]],["cumulative","logical"]]),S("binomdist","binom.dist"),R("binom.inv",function(e,t,n){for(var i=0;i<=e;++i)if(m(i,e,t,!0)>=n)return i;return new E("N/A")}).args([["trials","integer+"],["probability",["and","number",["[between]",0,1]]],["alpha",["and","number",["[between]",0,1]]]]),S("critbinom","binom.inv"),R("binom.dist.range",function(e,t,n,i){var r,o=0;for(r=n;r<=i;++r)o+=U(e,r)*Math.pow(t,r)*Math.pow(1-t,e-r);return o}).args([["trials","integer+"],["probability",["and","number",["[between]",0,1]]],["successes_min",["and","integer",["[between]",0,"$trials"]]],["successes_max",["or",["and","integer",["[between]","$successes_min","$trials"]],["null","$successes_min"]]]]),R("negbinom.dist",function(e,t,n,i){if(i){for(var r=0;e>=0;)r+=U(e+t-1,e)*Math.pow(n,t)*Math.pow(1-n,e),e--;return r}return U(e+t-1,e)*Math.pow(n,t)*Math.pow(1-n,e)}).args([["number_f","integer+"],["number_s","integer+"],["probability_s",["and","number",["[between]",0,1]]],["cumulative","logical"]]),S("negbinomdist","negbinom.dist"),R("address",function(e,t,n,i,r){var o=new M(e-1,t-1,n-1);return r&&o.setSheet(r,!0),i?o.print(0,0):o.print()}).args([["row","integer++"],["col","integer++"],["abs",["or",["null",1],["values",1,2,3,4]]],["a1",["or",["null",!0],"logical"]],["sheet",["or","null","string"]]]),R("areas",function(e){var t=0;return function n(e){e instanceof M||e instanceof A?t++:e instanceof D&&e.refs.forEach(n)}(e),t}).args([["ref","ref"]]),R("choose",function(e,t){return e>t.length?new E("N/A"):t[e-1]}).args([["*index","integer"],["+",["value","anything"]]]),R("column",function(e){return e?e instanceof M?e.col+1:this.asMatrix(e).mapCol(function(t){return t+e.topLeft.col+1}):this.formula.col+1}).args([["ref",["or","area","null"]]]),R("columns",function(e){return e instanceof B?e.width():e.width}).args([["ref",["or","area","#matrix"]]]),R("formulatext",function(e){var t=this.getRefCells(e)[0];return t.formula?t.formula.print(t.row,t.col):new E("N/A")}).args([["ref","ref"]]),R("hlookup",function(e,t,n,i){var r=null;return t.eachCol(function(n){var o=t.get(0,n);if(i){if(o>e)return!0;r=n}else if(o===e)return r=n,!0}),null==r?new E("N/A"):t.get(n-1,r)}).args([["value","anyvalue"],["range","matrix"],["row","integer++"],["approx",["or","logical",["null",!0]]]]),R("index",function(e,t,n,i,r){var o,s,a,l=this;if(t instanceof D&&(t=t.refs[r-1]),!n&&!i||!t)return e(new E("N/A"));if(t instanceof M&&(t=t.toRangeRef()),t instanceof A){if(n&&i)return i>t.width()||n>t.height()?e(new E("REF")):(o=t.toCell(n-1,i-1),void l.resolveCells([o],function(){e(l.getRefData(o))}));if(!n)return s=t.toColumn(i-1),void l.resolveCells([s],function(){e(l.asMatrix(s))});if(!i)return a=t.toRow(n-1),void l.resolveCells([a],function(){e(l.asMatrix(a))})}else if(t instanceof T){if(t.width>1&&t.height>1){if(n&&i)return e(t.get(n-1,i-1));if(!n)return e(t.mapRow(function(e){return t.get(e,i-1)}));if(!i)return e(t.mapCol(function(e){return t.get(n-1,e)}))}if(1==t.width)return e(t.get(n-1,0));if(1==t.height)return e(t.get(0,i-1))}else e(new E("REF"))}).argsAsync([["range",["or","ref","matrix"]],["row",["or","integer+","null"]],["col",["or","integer+","null"]],["areanum",["or","integer++",["null",1]]]]),R("indirect",function(e){var t,n;try{if(t=this.formula,n=C.parseFormula(t.sheet,t.row,t.col,e),!(n.ast instanceof B))throw 1;return n.ast.absolute(t.row,t.col)}catch(i){return new E("REF")}}).args([["thing","string"]]),R("match",function(e,t,n){var i,r=1;return 0===n?i=j(e):n===-1?i=j("<="+e):1===n&&(i=j(">="+e)),t.each(function(t){return null!=t&&i(t)?(0!==n&&e!=t&&--r,!0):void r++},!0)&&r>0?r:new E("N/A")}).args([["value","anyvalue"],["range","matrix"],["type",["or",["values",-1,0,1],["null",1]]]]),R("offset",function(e,t,n,i,r){var o=(e instanceof M?e:e.topLeft).clone();return o.row+=t,o.col+=n,o.row<0||o.col<0?new E("VALUE"):i>1||r>1?new A(o,new M(o.row+i-1,o.col+r-1)).setSheet(e.sheet,e.hasSheet()):o}).args([["ref","area"],["*rows","integer"],["*cols","integer"],["*height",["or","integer++",["null","$ref.height()"]]],["*width",["or","integer++",["null","$ref.width()"]]]]),R("row",function(e){return e?e instanceof M?e.row+1:this.asMatrix(e).mapRow(function(t){return t+e.topLeft.row+1}):this.formula.row+1}).args([["ref",["or","area","null"]]]),R("rows",function(e){return e instanceof B?e.height():e.height}).args([["ref",["or","area","#matrix"]]]),R("vlookup",function(e,t,n,i){var r=null;return"number"!=typeof e&&(i=!1),"string"==typeof e&&(e=e.toLowerCase()),t.eachRow(function(n){var o=t.get(n,0);if(i){if(o>e)return!0;r=n}else if("string"==typeof o&&(o=o.toLowerCase()),o===e)return r=n,!0}),null==r?new E("N/A"):t.get(r,n-1)}).args([["value","anyvalue"],["range","matrix"],["col","integer++"],["approx",["or","logical",["null",!0]]]]),R("date",function(e,t,n){return N(e,t-1,n)}).args([["*year","integer"],["*month","integer"],["*date","integer"]]),R("day",function(e){return I(e).date}).args([["*date","date"]]),R("month",function(e){return I(e).month+1}).args([["*date","date"]]),R("year",function(e){return I(e).year}).args([["*date","date"]]),R("weekday",function(e){return I(e).day+1}).args([["*date","date"]]),R("weeknum",function(e,t){var n,i=N(I(e).year,0,1),r=I(i);return 21==t?(n=3-(r.day+6)%7,n<0&&(n+=7),i+=n,r.date+=n,r.day=4,t=1):t=1==t?0:2==t?1:(t-10)%7,n=r.day-t,n<0&&(n+=7),i-=n,Math.ceil((e+1-i)/7)}).args([["*date","date"],["*type",["or",["null",1],["values",1,2,11,12,13,14,15,16,17,21]]]]),R("isoweeknum",function(e){var t=I(e),n=t.day||7,i=Math.floor((t.ord-n+10)/7);return i<1?g(t.year-1):53==i&&i>g(t.year)?1:i}).args([["*date","date"]]),R("now",function(){return F.dateToSerial(new Date)}).args([]),R("today",function(){return 0|F.dateToSerial(new Date)}).args([]),R("time",function(e,t,n){return F.packTime(e,t,n,0)}).args([["*hours","integer"],["*minutes","integer"],["*seconds","integer"]]),R("hour",function(e){return F.unpackTime(e).hours}).args([["*time","datetime"]]),R("minute",function(e){return F.unpackTime(e).minutes}).args([["*time","datetime"]]),R("second",function(e){return F.unpackTime(e).seconds}).args([["*time","datetime"]]),R("edate",function(e,t){var n=I(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),n=Math.min(n.date,L(r,i)),N(r,i,n)}).args([["*start_date","date"],["*months","integer"]]),R("eomonth",function(e,t){var n=I(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),n=L(r,i),N(r,i,n)}).args([["*start_date","date"],["*months","integer"]]),R("workday",function(e,t,n){var i,r=t>0?1:-1;for(t=Math.abs(t),i=I(e).day;t>0;)e+=r,i=(i+r)%7,i>0&&i<6&&n.indexOf(e)<0&&--t;return e}).args([["start_date","date"],["days","integer"],["holidays",["collect","date"]]]),R("networkdays",function(e,t,n){var i,r,o;for(e>t&&(i=e,e=t,t=i),r=0,o=I(e).day;e<=t;)o>0&&o<6&&n.indexOf(e)<0&&r++,e++,o=(o+1)%7;return r}).args([["start_date","date"],["end_date","date"],["holidays",["collect","date"]]]),R("days",function(e,t){return t-e}).args([["*start_date","date"],["*end_date","date"]]),F._days_360=v,R("days360",v).args([["*start_date","date"],["*end_date","date"],["*method",["or","logical",["null",!1]]]]),R("yearfrac",function(e,t,n){switch(n){case 0:return v(e,t,!1)/360;case 1:return(t-e)/z(I(e).year);case 2:return(t-e)/360;case 3:return(t-e)/365;case 4:return v(e,t,!0)/360}}).args([["*start_date","date"],["*end_date","date"],["*method",["or",["null",0],["values",0,1,2,3,4]]]]),R("datevalue",function(e){var t=F.parseDate(e);return t?F.dateToSerial(t):new E("VALUE")}).args([["*text","string"]]),R("timevalue",function(e){var t,n,i,r,o=e.toLowerCase().match(/(\d+):(\d+)(:(\d+)(\.(\d+))?)?\s*(am?|pm?)?/);return o?(t=parseFloat(o[1]),n=parseFloat(o[2]),i=o[3]?parseFloat(o[4]):0,r=o[7],r&&(t>12||t<1)?new E("VALUE"):(/^p/.test(r)&&(t+=12),F.packTime(t,n,i,0))):new E("VALUE")}).args([["*text","string"]]),R("mdeterm",function(e){var t=e.each(function(e){if("number"!=typeof e)return new E("VALUE")},!0);return t||e.determinant()}).args([["m",["and","matrix",["assert","$m.width == $m.height"]]]]),R("transpose",function(e){return e.transpose()}).args([["range","matrix"]]),R("mmult",function(e,t){return e.multiply(t)}).args([["a","matrix"],["b",["and","matrix",["assert","$b.height == $a.width"]]]]),R("munit",function(e){return new T(this).unit(e)}).args([["n","integer+"]]),R("minverse",function(e){var t=e.each(function(e){if("number"!=typeof e)return new E("VALUE")},!0);return t||e.inverse()||new E("VALUE")}).args([["m",["and","matrix",["assert","$m.width == $m.height"]]]]),R("rand",function(){return Math.random()}).args([]),R("randbetween",function(e,t){return e+Math.floor((t-e+1)*Math.random())}).args([["min","integer"],["max",["and","integer",["assert","$max >= $min"]]]]),R("true",function(){return!0}).args([]),R("false",function(){return!0}).args([]),R("roman",function(e){return k.arabicToRoman(e).toUpperCase()}).args([["*number","integer"]]),R("arabic",function(e){var t=k.romanToArabic(e);return null==t?new E("VALUE"):t}).args([["*roman","string"]]),R("base",function(e,t,n){for(var i=e.toString(t).toUpperCase();i.length<n;)i="0"+i;return i}).args([["*number","integer"],["*radix",["and","integer",["[between]",2,36]]],["*minLen",["or","integer+",["null",0]]]]),R("decimal",function(e,t){var n,i,r;for(e=e.toUpperCase(),n=0,i=0;i<e.length;++i){if(r=e.charCodeAt(i),r>=48&&r<=57)r-=48;else{if(!(r>=65&&r<55+t))return new E("VALUE");r-=55}n=n*t+r}return n}).args([["*text","string"],["*radix",["and","integer",["[between]",2,36]]]]),R("char",function(e){return String.fromCharCode(e)}).args([["*code","integer+"]]),W=/[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,
R("clean",function(e){return e.replace(W,"")}).args([["*text","string"]]),R("code",function(e){return e.charAt(0)}).args([["*text","string"]]),S("unichar","char"),S("unicode","code"),R("concatenate",function(e){var t,n="";for(t=0;t<e.length;++t)n+=e[t];return n}).args([["+",["*text","string"]]]),R("dollar",function(e,t){for(var n="$#,##0.DECIMALS;($#,##0.DECIMALS)",i="";t-- >0;)i+="0";return n=n.replace(/DECIMALS/g,i),x.formatting.text(e,n)}).args([["*number","number"],["*decimals",["or","integer++",["null",2]]]]),R("exact",function(e,t){return e===t}).args([["*text1","string"],["*text2","string"]]),R("find",function(e,t,n){var i=t.indexOf(e,n-1);return i<0?new E("VALUE"):i+1}).args([["*substring","string"],["*string","string"],["*start",["or","integer++",["null",1]]]]),R("fixed",function(e,t,n){for(var i=n?"0.DECIMALS":"#,##0.DECIMALS",r="";t-- >0;)r+="0";return i=i.replace(/DECIMALS/g,r),x.formatting.text(e,i)}).args([["*number","number"],["*decimals",["or","integer++",["null",2]]],["*noCommas",["or","boolean",["null",!1]]]]),R("left",function(e,t){return e.substr(0,t)}).args([["*text","string"],["*length",["or","integer+",["null",1]]]]),R("right",function(e,t){return e.substr(-t)}).args([["*text","string"],["*length",["or","integer+",["null",1]]]]),R("len",function(e){return e.length}).args([["*text","string"]]),R("lower",function(e){return e.toLowerCase()}).args([["*text","string"]]),R("upper",function(e){return e.toUpperCase()}).args([["*text","string"]]),R("ltrim",function(e){return e.replace(/^\s+/,"")}).args([["*text","string"]]),R("rtrim",function(e){return e.replace(/\s+$/,"")}).args([["*text","string"]]),R("trim",function(e){return e.replace(/^\s+|\s+$/,"")}).args([["*text","string"]]),R("mid",function(e,t,n){return e.substr(t-1,n)}).args([["*text","string"],["*start","integer++"],["*length","integer+"]]),R("proper",function(e){return e.toLowerCase().replace(/\b./g,function(e){return e.toUpperCase()})}).args([["*text","string"]]),R("replace",function(e,t,n,i){return e.substr(0,--t)+i+e.substr(t+n)}).args([["*text","string"],["*start","integer++"],["*length","integer+"],["*newText","string"]]),R("rept",function(e,t){for(var n="";t-- >0;)n+=e;return n}).args([["*text","string"],["*number","integer+"]]),R("search",function(e,t,n){var i=t.toLowerCase().indexOf(e.toLowerCase(),n-1);return i<0?new E("VALUE"):i+1}).args([["*substring","string"],["*string","string"],["*start",["or","integer++",["null",1]]]]),R("substitute",function(e,t,n,i){function r(){e=e.substring(0,o)+n+e.substring(o+t.length)}if(t===n)return e;for(var o=-1;(o=e.indexOf(t,o+1))>=0;)if(null==i)r();else if(0===--i){r();break}return e}).args([["*text","string"],["*oldText","string"],["*newText","string"],["*nth",["or","integer++","null"]]]),R("t",function(e){return"string"==typeof e?e:""}).args([["*value","anyvalue"]]),R("text",function(e,t){return x.formatting.text(e,t)}).args([["*value","anyvalue"],["*format","string"]]),R("value",function(e){return"number"==typeof e?e:"boolean"==typeof e?+e:(e=(e+"").replace(/[$€,]/g,""),e=parseFloat(e),isNaN(e)?new E("VALUE"):e)}).args([["*value","anyvalue"]]),b.prototype.toString=function(){return this.text},R("hyperlink",function(e,t){return new b(e,t)}).args([["*link","string"],["*text",["or","string",["null","$link"]]]]),R("iferror",function(e,t){return e instanceof E?t:e}).args([["*value","forced!"],["*value_if_error","anyvalue!"]]),j=function(){function e(e,t){if("string"==typeof t){var n=parseFloat(t);isNaN(n)||n!=t||(t=n)}return function(n){var i=t;return"string"==typeof n&&"string"==typeof i&&(n=n.toLowerCase(),i=i.toLowerCase()),e(n,i)}}function t(e){var t,n;return"string"==typeof e&&(e=e.toLowerCase()),/^[0-9.]+%$/.test(e)?(n=e.substr(0,e.length-1),t=parseFloat(n),isNaN(t)||t!=n||(e=t/100)):/^[0-9.]+$/.test(e)&&(t=parseFloat(e),isNaN(t)||t!=e||(e=t)),e}function n(e,n){return t(e)<t(n)}function i(e,n){return t(e)<=t(n)}function r(e,n){return t(e)>t(n)}function o(e,n){return t(e)>=t(n)}function s(e,t){return!a(e,t)}function a(e,n){return n instanceof RegExp?n.test(e):("string"!=typeof e&&"string"!=typeof n||(e+="",n+=""),t(e)==t(n))}var l=Object.create(null);return function(t){var u,c;return"function"==typeof t?t:(u=/^=(.*)$/.exec(t))?e(a,u[1]):(u=/^<>(.*)$/.exec(t))?e(s,u[1]):(u=/^<=(.*)$/.exec(t))?e(i,u[1]):(u=/^<(.*)$/.exec(t))?e(n,u[1]):(u=/^>=(.*)$/.exec(t))?e(o,u[1]):(u=/^>(.*)$/.exec(t))?e(r,u[1]):/[?*]/.exec(t)?(c=l[t],c||(c=t.replace(/(~\?|~\*|[\]({\+\.\|\^\$\\})\[]|[?*])/g,function(e){switch(e){case"~?":return"\\?";case"~*":return"\\*";case"?":return".";case"*":return".*";default:return"\\"+e}}),c=l[t]=RegExp("^"+c+"$","i")),e(a,c)):e(a,t)}}())},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.functions.2.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e){var n,i,r,o;if(ut(e)>=3.3)return 1-t(e);for(n=e>0?1:-1,n==-1&&(e=-e),i=0,r=1,o=1;o<100;o++)i+=r,r*=2*e*e/(2*o+1);return 2*n/Math.sqrt(Math.PI)*e*Math.exp(-e*e)*i}function t(t){var n,i,r;if(ut(t)<3.3)return 1-e(t);for(n=1,t<0&&(n=-1,t=-t),i=t,r=8;r>=1;r-=.5)i=t+r/i;return i=1/(t+i),1==n?Math.exp(-t*t)/Math.sqrt(Math.PI)*i:2-Math.exp(-t*t)/Math.sqrt(Math.PI)*i}function n(e){var t,n=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],i=e,r=e+5.5,o=n[0];for(r-=(e+.5)*Math.log(r),t=1;t<=6;t++)i+=1,o+=n[t]/i;return-r+Math.log(Math.sqrt(2*Math.PI)*o/e)}function i(e){if(e>0)return Math.exp(n(e));var t=Math.PI,r=-e;return-t/(r*i(r)*Math.sin(t*r))}function r(e,t){return n(e)+n(t)-n(e+t)}function o(e,t){return Math.exp(r(e,t))}function s(e,t){return t<e+1?a(e,t):1-l(e,t)}function a(e,t){var i,r=1/e,o=r,s=e,a=n(e);for(i=1;i<=st&&(s++,o*=t/s,r+=o,!(ut(o)<ut(r)*at));i++);return r*Math.exp(-t+e*Math.log(t)-a)}function l(e,t){var i,r,o=lt,s=o,a=0,l=1,u=t+1-e,c=n(e);for(i=1;i<=st&&(a=u+l*a,ut(a)<lt&&(a=lt),s=u+l/s,ut(s)<lt&&(s=lt),a=1/a,r=s*a,o*=r,!(ut(r-1)<at));i++)u+=2,l=-i*(i-e);return o*Math.exp(-t-c+e*Math.log(t))}function u(e,t,n,r){return r?s(t,e/n):Math.pow(e/n,t-1)*Math.exp(-e/n)/(n*i(t))}function c(e,t,n){var i,r,o,s,a,l;if(0===e)return 0;if(1==e)return 1/0;for(i=0,r=10,o=0,s=t*n,s>1&&(r*=s),a=0;a<st&&(o=.5*(i+r),l=u(o,t,n,!0),!(ut(e-l)<1e-16));a++)l>e?r=o:i=o;return o}function h(t,n){return n?.5+.5*e(t/Math.sqrt(2)):Math.exp(-t*t/2)/Math.sqrt(2*Math.PI)}function d(e){var t,n,i=[-39.69683028665376,220.9460984245205,-275.9285104469687,138.357751867269,-30.66479806614716,2.506628277459239],r=[-54.47609879822406,161.5858368580409,-155.6989798598866,66.80131188771972,-13.28068155288572],o=[-.007784894002430293,-.3223964580411365,-2.400758277161838,-2.549732539343734,4.374664141464968,2.938163982698783],s=[.007784695709041462,.3224671290700398,2.445134137142996,3.754408661907416],a=.02425,l=1-a;return e<a?(t=Math.sqrt(-2*Math.log(e)),(((((o[0]*t+o[1])*t+o[2])*t+o[3])*t+o[4])*t+o[5])/((((s[0]*t+s[1])*t+s[2])*t+s[3])*t+1)):l<e?(t=Math.sqrt(-2*Math.log(1-e)),-(((((o[0]*t+o[1])*t+o[2])*t+o[3])*t+o[4])*t+o[5])/((((s[0]*t+s[1])*t+s[2])*t+s[3])*t+1)):(t=e-.5,n=t*t,(((((i[0]*n+i[1])*n+i[2])*n+i[3])*n+i[4])*n+i[5])*t/(((((r[0]*n+r[1])*n+r[2])*n+r[3])*n+r[4])*n+1))}function f(e,t,n,i){return i?h((e-t)/n,!0):Math.exp(-(e-t)*(e-t)/(2*n*n))/(n*Math.sqrt(2*Math.PI))}function p(e,t,n){return t+n*d(e)}function m(e,t,n){return Math.exp((t-1)*Math.log(e)+(n-1)*Math.log(1-e)-r(t,n))}function g(e,t,n){var i=Math.exp(t*Math.log(e)+n*Math.log(1-e)-r(t,n));return e<(t+1)/(t+n+2)?i*v(t,n,e)/t:1-i*v(n,t,1-e)/n}function v(e,t,n){var i,r,o,s,a,l=e+t,u=e+1,c=e-1,h=1,d=1-l*n/u;for(ut(d)<lt&&(d=lt),d=1/d,a=d,i=1;i<=st&&(r=2*i,o=i*(t-i)*n/((c+r)*(e+r)),d=1+o*d,ut(d)<lt&&(d=lt),h=1+o/h,ut(h)<lt&&(h=lt),d=1/d,a*=d*h,o=-(e+i)*(l+i)*n/((e+r)*(u+r)),d=1+o*d,ut(d)<lt&&(d=lt),h=1+o/h,ut(h)<lt&&(h=lt),d=1/d,s=d*h,a*=s,!(ut(s-1)<at));i++);return a}function b(e,t,n){var i,r,o=0,s=1,a=0;for(i=0;i<st&&(a=.5*(o+s),r=g(a,t,n),!(ut(e-r)<at));i++)r>e?s=a:o=a;return a}function w(e,t,n,i,r){return g((e-i)/(r-i),t,n)}function y(e,t,n,i,r,o){return i?g((e-r)/(o-r),t,n):m((e-r)/(o-r),t,n)/(o-r)}function _(e,t,n,i,r){return i+(r-i)*b(e,t,n)}function k(e,t,n){return u(e,t/2,2,n)}function x(e,t){return 1-k(e,t,!0)}function C(e,t){return c(e,t/2,2)}function F(e,t){return C(1-e,t)}function R(e,t){var n,i,r,o,s,a=e.length,l=e[0].length,u=0;for(n=0;n<a;n++)for(i=0;i<l;i++)r=t[n][i],o=e[n][i]-r,o*=o,u+=o/r;return s=(a-1)*(l-1),x(u,s)}function S(e,t,n){return n?1-Math.exp(-t*e):t*Math.exp(-t*e)}function E(e,t,n){var i,r;if(n)return 1-k(2*t,2*(e+1),!0);for(i=0,r=2;r<=e;r++)i+=Math.log(r);return Math.exp(e*Math.log(t)-t-i)}function A(e,t,n,i){if(i)return g(t*e/(n+t*e),t/2,n/2);var r=t/n;return t/=2,n/=2,r/o(t,n)*Math.pow(r*e,t-1)/Math.pow(1+r*e,t+n)}function M(e,t,n){return 1-A(e,t,n,!0)}function D(e,t,n){return n/t*(1/_(e,n/2,t/2,0,1)-1)}function T(e,t,n){return n/t*(1/_(1-e,n/2,t/2,0,1)-1)}function B(e){var t,n=0,i=e.length;for(t=0;t<i;t++)n+=e[t];return n/i}function L(e,t){var n,i,r=0,o=e.length;for(n=0;n<o;n++)i=e[n]-t,r+=i*i;return r/(o-1)}function N(e,t){var n=e.length-1,i=t.length-1,r=L(e,B(e)),o=L(t,B(t));if(!r||!o)throw new Ze("DIV/0");return 2*A(r/o,n,i,!0)}function I(e){return.5*Math.log((1+e)/(1-e))}function z(e){var t=Math.exp(2*e);return(t-1)/(t+1)}function P(e,t,n){return n?1-.5*g(t/(e*e+t),t/2,.5):1/(Math.sqrt(t)*o(.5,t/2))*Math.pow(1+e*e/t,-(t+1)/2)}function H(e,t){return 1-P(e,t,!0)}function $(e,t){return e<0&&(e=-e),2*H(e,t)}function V(e,t){var n=b(2*Math.min(e,1-e),t/2,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}function O(e,t){return V(1-e/2,t)}function U(e,t,n,i){var r,o,s,a,l,u,c,h,d,f,p,m,g,v,b,w,y=e.length,_=t.length;if(1==i){for(s=0,a=0,l=0;l<y;l++)u=e[l]-t[l],s+=u,a+=u*u;return c=s/y,r=c/Math.sqrt((a-s*c)/(y*(y-1))),1==n?H(r,y-1):$(r,y-1)}return h=B(e),d=B(t),f=L(e,h),p=L(t,d),3==i?(m=f/y,g=p/_,v=m+g,b=m/v,w=g/v,o=1/(b*b/(y-1)+w*w/(_-1)),r=ut(h-d)/Math.sqrt(v),1==n?H(r,o):$(r,o)):(o=y+_-2,r=ut(h-d)*Math.sqrt(o*y*_/((y+_)*((y-1)*f+(_-1)*p))),1==n?H(r,o):$(r,o))}function q(e,t,n){return-V(e/2,n-1)*t/Math.sqrt(n)}function W(e,t,n){return-d(e/2)*t/Math.sqrt(n)}function j(e){return h(e,!0)-.5}function K(e){return h(e)}function J(t,n,i,r){if(r)return.5+.5*e((Math.log(t)-n)/(i*Math.sqrt(2)));var o=Math.log(t)-n;return Math.exp(-o*o/(2*i*i))/(t*i*Math.sqrt(2*Math.PI))}function G(e,t,n){return Math.exp(p(e,t,n))}function Y(e,t,n,i){var r,o,s,a=e.length,l=0;for(r=0;r<a;r++){if(t[r]<=0||t[r]>1)throw new Ze("NUM");l+=t[r]}if(1!=l)throw new Ze("NUM");for(o=0,r=0;r<a;r++)s=e[r],s>=n&&s<=i&&(o+=t[r]);return o}function Q(e,t){var n,i,r,o=B(t),s=B(e),a=0,l=0;for(n=0,i=e.length;n<i;n++)r=t[n]-o,a+=r*(e[n]-s),l+=r*r;return a/l}function X(e,t){var n,i,r,o=B(t),s=B(e),a=0,l=0;for(n=0,i=e.length;n<i;n++)r=t[n]-o,a+=r*(e[n]-s),l+=r*r;return s-a*o/l}function Z(e,t){var n,i,r,o,s=B(e),a=B(t),l=0,u=0,c=0;for(n=0,i=e.length;n<i;n++)r=e[n]-s,o=t[n]-a,l+=r*o,u+=r*r,c+=o*o;return l/Math.sqrt(u*c)}function ee(e,t){var n=Z(e,t);return n*n}function te(e,t){var n,i,r,o=t.length,s=B(t),a=B(e),l=0,u=0,c=0;for(n=0;n<o;n++)i=t[n]-s,r=e[n]-a,l+=r*r,u+=i*r,c+=i*i;return Math.sqrt((l-u*u/c)/(o-2))}function ne(e,t,n){var i,r,o,s,a,l,u=B(n),c=B(t),h=0,d=0;for(i=0,r=n.length;i<r;i++)o=n[i]-u,s=t[i]-c,h+=o*s,d+=o*o;if(0===d)throw new Ze("N/A");return a=h/d,l=c-a*u,l+a*e}function ie(e){var t,n=e.height,i=0;for(t=0;t<n;t++)i+=e.data[t][0];return i/n}function re(e,t){var n,i,r=e.height,o=0;for(n=0;n<r;n++)i=e.data[n][0]-t,o+=i*i;return o}function oe(e,t,n,i){var r,o,s,a,l,u,c,h,d,f,p,m,g,v,b,w,y,_,k=0;for(t||(t=e.map(function(){return++k})),n&&(t=t.clone(),t.eachRow(function(e){t.data[e].unshift(1)}),++t.width),r=t.transpose(),o=r.multiply(t).inverse().multiply(r).multiply(e),s=[],k=o.height-1;k>=0;k--)s.push(o.data[k][0]);if(n||s.push(0),!i)return this.asMatrix([s]);for(a=t.multiply(o),l=e.adds(a,!0),u=n?ie(a):0,c=re(a,u),h=n?ie(l):0,d=re(l,h),f=[],f.push(c,d),p=c/(c+d),m=e.height-t.width,g=Math.sqrt(d/m),v=[],v.push(p,g),b=n?c/(t.width-1)/(d/m):p/t.width/((1-p)/m),w=[],w.push(b,m),y=r.multiply(t).inverse(),_=[],k=y.height-1;k>=0;k--)_.push(Math.sqrt(y.data[k][k]*d/m));return this.asMatrix([s,_,v,w,f])}function se(e,t,n,i){return oe.call(this,e.map(Math.log),t,n,i).map(Math.exp)}function ae(e,t,n,i){var r,o,s=0;return t||(t=e.map(function(){return++s})),i&&(t=t.clone(),t.eachRow(function(e){t.data[e].unshift(1)}),++t.width),r=t.transpose(),o=r.multiply(t).inverse().multiply(r).multiply(e),n?i&&(n=n.clone(),n.eachRow(function(e){n.data[e].unshift(1)}),++n.width):n=t,n.multiply(o)}function le(e,t,n,i){return ae.call(this,e.map(Math.log),t,n,i).map(Math.exp)}function ue(e,t,n,i){var r,o,s,a,l,u=n||20,c=i||1e-7,h=t;for(r=1;r<=u;r++)if(o=e(h),s=o[0],a=o[1],l=s/a,h-=l,Math.abs(l)<c)return h;return new Ze("NUM")}function ce(e,t,n,i,r){var o=Math.pow(1+e,t),s=e?(o-1)/e:t;return-(i*o+n*s*(1+e*r))}function he(e,t,n,i,r){if(!e)return-i-n*t;var o=Math.pow(1+e,t);return-(i+n*(o-1)/e*(1+e*r))/o}function de(e,t,n,i,r){if(!e)return-(i+n)/t;var o=Math.pow(1+e,t);return-e*(i+n*o)/((1+e*r)*(o-1))}function fe(e,t,n,i,r){if(!e)return-(i+n)/t;var o=t*(1+e*r);return Math.log((o-i*e)/(o+n*e))/Math.log(1+e)}function pe(e,t,n,i,r,o){function s(o){var s=Math.pow(1+o,e-1),a=s*(1+o);return[n*a+t*(1/o+r)*(a-1)+i,e*n*s+t*(-(a-1)/(o*o)+(1/o+r)*e*s)]}return ue(s,o)}function me(e,t,n,i,r,o){var s,a;return 1==o&&1==t?0:(s=de(e,n,i,r,o),a=ce(e,t-1,s,i,o)*e,o?a/(1+e):a)}function ge(e,t,n,i,r,o){var s=de(e,n,i,r,o);return s-me(e,t,n,i,r,o)}function ve(e,t,n,i,r,o){var s,a,l,u,c,h;return 1==o&&(i--,r--),s=Math.pow(1+e,t),a=Math.pow(1+e,i-1),l=Math.pow(1+e,r),u=e*n*s/(s-1),c=a*n-(a-1)/e*u,h=l*n-(l-1)/e*u,h-c}function be(e,t,n,i,r,o){var s,a=0;for(s=i;s<=r;s++)a+=me(e,s,t,n,0,o);return a}function we(e,t){var n,i,r=0;for(n=0,i=t.length;n<i;n++)r+=t[n]*Math.pow(1+e,-n-1);return r}function ye(e,t){function n(t){var n,i,r=0,o=0;for(n=0,i=e.length;n<i;n++)r+=e[n]*Math.pow(1+t,-n-1),o+=-n*e[n]*Math.pow(1+t,-n-2);return[r,o]}return ue(n,t)}function _e(e,t){return Math.pow(1+e/t,t)-1}function ke(e,t){return t*(Math.pow(e+1,1/t)-1)}function xe(e,t,n){var i,r,o=0;for(i=0,r=t.length;i<r;i++)o+=t[i]*Math.pow(1+e,(n[0]-n[i])/365);return o}function Ce(e,t,n){function i(n){var i,r,o,s=e[0],a=0;for(i=1,r=e.length;i<r;i++)o=(t[0]-t[i])/365,s+=e[i]*Math.pow(1+n,o),a+=o*e[i]*Math.pow(1+n,o-1);return[s,a]}return ue(i,n)}function Fe(e,t,n,i){var r=-i*e;return r*(1-t/n)}function Re(e,t,n,i,r){var o,s,a=1-Math.pow(t/e,1/n);if(a=Math.floor(1e3*a+.5)/1e3,o=e*a*r/12,1==i)return o;for(s=1;s<n;s++){if(s==i-1)return(e-o)*a;o+=(e-o)*a}return(e-o)*a*(12-r)/12}function Se(e,t,n,i,r){var o=r/n,s=-e*(Math.pow(1-o,i-1)-1),a=(e-s)*o;return a=Math.min(a,Math.max(0,e-s-t))}function Ee(e,t,n){return(e-t)/n}function Ae(e,t,n,i){return(e-t)*(n-i+1)*2/(n*(n+1))}function Me(e,t,n,i,r,o,s){function a(e,n){var i,r,o;return r=1==f?1==n?e:0:e*Math.pow(1-f,n-1),o=e*Math.pow(1-f,n),i=o<t?r-t:r-o,i<0?0:i}function l(e,n,i){var r,o,s,l=e-t,u=Math.ceil(i),c=0,h=0,d=!1;for(o=1;o<=u;o++)d?r=c:(s=a(e,o),c=l/(n-o+1),c>s?(r=c,d=!0):(r=s,l-=s)),o==u&&(r*=i+1-u),h+=r;return h}var u,c,h,d,f=o>=n?1:o/n,p=Math.floor(i),m=Math.ceil(r),g=0;if(s)for(u=p+1;u<=m;u++)c=a(e,u),u==p+1?c*=Math.min(r,p+1)-i:u==m&&(c*=r+1-m),g+=c;else h=n,i!=Math.floor(i)&&o>1&&i>=n/2&&(d=i-n/2,i=n/2,r-=d,h+=1),e-=l(e,h,i),g=l(e,n-i,r-i);return g}function De(e,t){var n=tt(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),n=Math.min(n.date,it(r,i)),et(r,i,n)}function Te(e,t,n){return 1==n||2==n||3==n?t-e:rt(e,t,n)}function Be(e,t,n){var i,r,o,s=tt(e),a=tt(t),l=a.year-s.year;l>0&&(l=(l-1)*n),o=12/n;do l++,i=De(t,-l*o);while(e<i);return l--,r=De(t,-l*o),[i,r]}function Le(e,t,n){var i,r,o,s=tt(t),a=tt(e),l=s.year-a.year;for(l>0&&(l=(l-1)*n),i=e,o=12/n;t>i;)r=i,l++,i=De(e,l*o);return[r,i]}function Ne(e,t,n,i){var r=Be(e,t,n)[0];return Te(r,e,i)}function Ie(e,t,n,i){if(1==i){var r=Be(e,t,n);return Te(r[0],r[1],1)}return 3==i?365/n:360/n}function ze(e,t,n,i){var r=Be(e,t,n)[1];return Te(e,r,i)}function Pe(e,t,n){return Be(e,t,n)[0]}function He(e,t,n){return Be(e,t,n)[1]}function $e(e,t,n){var i=tt(e),r=tt(t),o=12*(r.year-i.year)+r.month-i.month;return 1+(o*n/12|0)}function Ve(e,t){return 3==t?365:1==t?nt(e)?366:365:360}function Oe(e,t,n,i,r){var o=Ve(tt(t).year,r);return n*i*Te(e,t,r)/o}function Ue(e,t,n,i,r,o,s,a){function l(e,t){return(t-e)*o/v|0}var u,c,h,d,f,p,m=0,g=r*i/o,v=s%2===0?360:365;return n<=t?(u=Be(n,t,o),c=u[0],h=u[1],c<=e?g*Te(e,n,s)/Te(c,h,s):(u=Be(e,c,o),d=u[0],f=u[1],p=l(f,n),g*(p+Te(e,f,s)/Te(d,f,s)+(n<h?Te(c,n,s)/Te(c,h,s):0)))):(u=Le(t,n,o),c=u[0],h=u[1],p=l(t,n),m=h==n?g*p:g*(p+Te(c,n,s)/Te(c,h,s)),a?(u=Be(e,t,o),c=u[0],h=u[1],p=l(e,t),m+=g*(p+Te(e,h,s)/Te(c,h,s))):m)}function qe(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return(i-n)/i*o/Te(e,t,r)}function We(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return(i-n)/n*o/Te(e,t,r)}function je(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return n/(1-i*Te(e,t,r)/o)}function Ke(e,t,n,i,r,o,s){var a=1+((t-e)*o/(s%2===0?360:365)|0),l=Be(e,t,o),u=l[0],c=l[1],h=Te(u,e,s),d=Te(e,c,s),f=Te(u,c,s),p=100*n/o,m=i/o,g=d/f;return 1==a?(r+p)/(1+g*m)-h/f*p:r/Math.pow(1+m,a-1+g)+p*Math.pow(1+m,1-a-g)*(Math.pow(1+m,a)-1)/m-h/f*p}function Je(e,t,n,i,r){var o=Te(e,t,r),s=Ve(tt(t).year,r);return i-n*i*o/s}var Ge,Ye,Qe,Xe,Ze,et,tt,nt,it,rt,ot,st,at,lt,ut;kendo.support.browser.msie&&kendo.support.browser.version<9||(Ge=kendo.spreadsheet,Ye=Ge.calc,Qe=Ye.runtime,Xe=Qe.defineFunction,Ze=Qe.CalcError,et=Qe.packDate,tt=Qe.unpackDate,nt=Qe.isLeapYear,it=Qe.daysInMonth,rt=Qe._days_360,Xe("ERF",function(t,n){return null==n?e(t):e(n)-e(t)}).args([["lower_limit","number"],["upper_limit",["or","number","null"]]]),Xe("ERFC",t).args([["x","number"]]),Xe("GAMMALN",n).args([["x","number++"]]),Xe("GAMMA",i).args([["x","number"]]),Xe("GAMMA.DIST",u).args([["x","number+"],["alpha","number++"],["beta","number++"],["cumulative","logical"]]),Xe("GAMMA.INV",c).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"]]),Xe("NORM.S.DIST",h).args([["z","number"],["cumulative","logical"]]),Xe("NORM.S.INV",d).args([["p",["and","number",["[between]",0,1]]]]),Xe("NORM.DIST",f).args([["x","number"],["mean","number"],["stddev","number++"],["cumulative","logical"]]),Xe("NORM.INV",p).args([["p",["and","number",["[between]",0,1]]],["mean","number"],["stddev","number++"]]),Xe("BETADIST",w).args([["x","number"],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]],["?",["assert","$x >= $A","NUM"]],["?",["assert","$x <= $B","NUM"]],["?",["assert","$A < $B","NUM"]]]),Xe("BETA.DIST",y).args([["x","number"],["alpha","number++"],["beta","number++"],["cumulative","logical"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]],["?",["assert","$x >= $A","NUM"]],["?",["assert","$x <= $B","NUM"]],["?",["assert","$A < $B","NUM"]]]),Xe("BETA.INV",_).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]]]),Xe("CHISQ.DIST",k).args([["x","number+"],["deg_freedom","integer++"],["cumulative","logical"]]),Xe("CHISQ.DIST.RT",x).args([["x","number+"],["deg_freedom","integer++"]]),Xe("CHISQ.INV",C).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]),Xe("CHISQ.INV.RT",F).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]),Xe("CHISQ.TEST",function(e,t){return R(e.data,t.data)}).args([["actual_range","matrix"],["expected_range","matrix"],["?",["assert","$actual_range.width == $expected_range.width"]],["?",["assert","$actual_range.height == $expected_range.height"]]]),Xe("EXPON.DIST",S).args([["x","number+"],["lambda","number++"],["cumulative","logical"]]),Xe("POISSON.DIST",E).args([["x","integer+"],["mean","number+"],["cumulative","logical"]]),Xe("F.DIST",A).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"],["cumulative","logical"]]),Xe("F.DIST.RT",M).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Xe("F.INV",T).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Xe("F.INV.RT",D).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Xe("F.TEST",N).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]),Xe("FISHER",I).args([["x",["and","number",["(between)",-1,1]]]]),Xe("FISHERINV",z).args([["y","number"]]),Xe("T.DIST",P).args([["x","number"],["deg_freedom","integer++"],["cumulative","logical"]]),Xe("T.DIST.RT",H).args([["x","number"],["deg_freedom","integer++"]]),Xe("T.DIST.2T",$).args([["x","number+"],["deg_freedom","integer++"]]),Xe("T.INV",V).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]),Xe("T.INV.2T",O).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]),Xe("T.TEST",U).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["tails",["and","integer",["values",1,2]]],["type",["and","integer",["values",1,2,3]]],["?",["assert","$type != 1 || $array1.length == $array2.length","N/A"]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]),Xe("CONFIDENCE.T",q).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++",["assert","$size != 1","DIV/0"]]]]),Xe("CONFIDENCE.NORM",W).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++"]]]),Xe("GAUSS",j).args([["z","number"]]),Xe("PHI",K).args([["x","number"]]),Xe("LOGNORM.DIST",J).args([["x","number++"],["mean","number"],["standard_dev","number++"],["cumulative","logical"]]),Xe("LOGNORM.INV",G).args([["probability",["and","number",["(between)",0,1]]],["mean","number"],["standard_dev","number++"]]),Xe("PROB",Y).args([["x_range",["collect","number",1]],["prob_range",["collect","number",1]],["lower_limit","number"],["upper_limit",["or","number",["null","$lower_limit"]]],["?",["assert","$prob_range.length == $x_range.length","N/A"]]]),Xe("SLOPE",Q).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Xe("INTERCEPT",X).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Xe("PEARSON",Z).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array2.length == $array1.length","N/A"]],["?",["assert","$array2.length > 0 && $array1.length > 0","N/A"]]]),Xe("RSQ",ee).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]],["?",["assert","$known_x.length != 1 && $known_y.length != 1","N/A"]]]),Xe("STEYX",te).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length >= 3 && $known_y.length >= 3","DIV/0"]]]),Xe("FORECAST",ne).args([["x","number"],["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Xe("LINEST",oe).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]),Xe("LOGEST",se).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]),Xe("TREND",ae).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]),Xe("GROWTH",le).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]),Xe("FV",ce).args([["rate","number"],["nper","number"],["pmt",["or","number",["null",0]]],["pv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$pmt || $pv"]]]),Xe("PV",he).args([["rate","number"],["nper","number"],["pmt",["or","number",["null",0]]],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$pmt || $fv"]]]),Xe("PMT",de).args([["rate","number"],["nper","number"],["pmt","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]),Xe("NPER",fe).args([["rate","number"],["pmt","number"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]),Xe("RATE",pe).args([["nper","number"],["pmt",["or","number",["null",0]]],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["guess",["or","number++",["null",.01]]],["?",["assert","$pmt || $fv"]]]),Xe("IPMT",me).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$per >= 1 && $per <= $nper"]]]),Xe("PPMT",ge).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$per >= 1 && $per <= $nper"]]]),Xe("CUMPRINC",ve).args([["rate","number++"],["nper","number++"],["pv","number++"],["start_period","number++"],["end_period","number++"],["type",["or",["values",0,1],["null",0]]],["?",["assert","$end_period >= $start_period","NUM"]]]),Xe("CUMIPMT",be).args([["rate","number++"],["nper","number++"],["pv","number++"],["start_period","number++"],["end_period","number++"],["type",["or",["values",0,1],["null",0]]],["?",["assert","$end_period >= $start_period","NUM"]]]),Xe("NPV",we).args([["rate","number"],["values",["collect","number"]],["?",["assert","$values.length > 0","N/A"]]]),Xe("IRR",ye).args([["values",["collect","number",1]],["guess",["or","number",["null",.1]]]]),Xe("EFFECT",_e).args([["nominal_rate","number++"],["npery","integer++"]]),Xe("NOMINAL",ke).args([["effect_rate","number++"],["npery","integer++"]]),Xe("XNPV",xe).args([["rate","number"],["values",["collect","number",1]],["dates",["collect","date",1]],["?",["assert","$values.length == $dates.length","NUM"]]]),Xe("XIRR",Ce).args([["values",["collect","number",1]],["dates",["collect","date",1]],["guess",["or","number",["null",.1]]],["?",["assert","$values.length == $dates.length","NUM"]]]),Xe("ISPMT",Fe).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["?",["assert","$per >= 1 && $per <= $nper"]]]),Xe("DB",Re).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["month",["or","number",["null",12]]]]),Xe("DDB",Se).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["factor",["or","number",["null",2]]]]),Xe("SLN",Ee).args([["cost","number"],["salvage","number"],["life","number++"]]),Xe("SYD",Ae).args([["cost","number"],["salvage","number"],["life","number++"],["per","number++"]]),Xe("VDB",Me).args([["cost","number+"],["salvage","number+"],["life","number++"],["start_period","number+"],["end_period","number+"],["factor",["or","number+",["null",2]]],["no_switch",["or","logical",["null",!1]]],["?",["assert","$end_period >= $start_period","NUM"]]]),ot=[["settlement","date"],["maturity","date"],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]],Xe("COUPDAYBS",Ne).args(ot),Xe("COUPDAYS",Ie).args(ot),Xe("COUPDAYSNC",ze).args(ot),Xe("COUPPCD",Pe).args(ot),Xe("COUPNCD",He).args(ot),Xe("COUPNUM",$e).args(ot),Xe("ACCRINTM",Oe).args([["issue","date"],["settlement","date"],["rate","number++"],["par",["or",["null",1e3],"number++"]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$issue < $settlement","NUM"]]]),Xe("ACCRINT",Ue).args([["issue","date"],["first_interest","date"],["settlement","date"],["rate","number++"],["par",["or",["null",1e3],"number++"]],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["calc_method",["or","logical",["null",!0]]],["?",["assert","$issue < $settlement","NUM"]]]),Xe("DISC",qe).args([["settlement","date"],["maturity","date"],["pr","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Xe("INTRATE",We).args([["settlement","date"],["maturity","date"],["investment","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Xe("RECEIVED",je).args([["settlement","date"],["maturity","date"],["investment","number++"],["discount","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Xe("PRICE",Ke).args([["settlement","date"],["maturity","date"],["rate","number++"],["yld","number++"],["redemption","number++"],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Xe("PRICEDISC",Je).args([["settlement","date"],["maturity","date"],["discount","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),st=300,at=2.2204e-16,lt=1e-30,ut=Math.abs)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/borderpalette.min",["kendo.core.min","kendo.colorpicker.min","kendo.popup.min"],e)}(function(){!function(e){function t(e){return function(t){return t.preventDefault(),e.apply(this,arguments)}}var n,i,r,o,s;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=["allBorders","insideBorders","insideHorizontalBorders","insideVerticalBorders","outsideBorders","leftBorder","topBorder","rightBorder","bottomBorder","noBorders"],r=e.spreadsheet.messages.borderPalette={allBorders:"All borders",insideBorders:"Inside borders",insideHorizontalBorders:"Inside horizontal borders",insideVerticalBorders:"Inside vertical borders",outsideBorders:"Outside borders",leftBorder:"Left border",topBorder:"Top border",rightBorder:"Right border",bottomBorder:"Bottom border",noBorders:"No border",reset:"Reset color",customColor:"Custom color...",apply:"Apply",cancel:"Cancel"},o=e.ui.Widget.extend({init:function(n,i){e.ui.Widget.call(this,n,i),this.element=n,this.color=i.color,this._resetButton(),this._colorPalette(),this._customColorPalette(),this._customColorButton(),this.resetButton.on("click",t(this.resetColor.bind(this))),this.customColorButton.on("click",t(this.customColor.bind(this)))},options:{name:"ColorChooser"},events:["change"],destroy:function(){e.unbind(this.dialog.element.find(".k-action-buttons")),this.dialog.destroy(),this.colorPalette.destroy(),this.resetButton.off("click"),this.customColorButton.off("click")},value:function(e){return void 0===e?this.color:(this.color=e,this.customColorButton.find(".k-icon").css("background-color",this.color),this.colorPalette.value(null),this.flatColorPicker.value(this.color),void 0)},_change:function(e){this.color=e,this.trigger("change",{value:e})},_colorPalette:function(){var e=n("<div />",{"class":"k-spreadsheet-color-palette"}),t=this.colorPalette=n("<div />").kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],
value:this.color,change:function(e){this.customColorButton.find(".k-icon").css("background-color","transparent"),this.flatColorPicker.value(null),this._change(e.value)}.bind(this)}).data("kendoColorPalette");e.append(t.wrapper).appendTo(this.element)},_customColorPalette:function(){var t,i,o=n("<div />",{"class":"k-spreadsheet-window",html:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+r.apply+"</button><button class='k-button' data-bind='click: close'>"+r.cancel+"</button></div>"}),s=this.dialog=o.appendTo(document.body).kendoWindow({animation:!1,scrollable:!1,resizable:!1,maximizable:!1,modal:!0,visible:!1,width:268,open:function(){this.center()}}).data("kendoWindow");s.one("activate",function(){this.element.find("[data-role=flatcolorpicker]").data("kendoFlatColorPicker")._hueSlider.resize()}),t=this.flatColorPicker=s.element.children().first().kendoFlatColorPicker().data("kendoFlatColorPicker"),i=e.observable({apply:function(){this.customColorButton.find(".k-icon").css("background-color",t.value()),this.colorPalette.value(null),this._change(t.value()),s.close()}.bind(this),close:function(){t.value(null),s.close()}}),e.bind(s.element.find(".k-action-buttons"),i)},_resetButton:function(){this.resetButton=n("<a class='k-button k-reset-color' href='#'><span class='k-icon k-font-icon k-i-reset-color'></span>"+r.reset+"</a>").appendTo(this.element)},_customColorButton:function(){this.customColorButton=n("<a class='k-button k-custom-color' href='#'><span class='k-icon'></span>"+r.customColor+"</a>").appendTo(this.element)},resetColor:function(){this.colorPalette.value(null),this.flatColorPicker.value(null),this._change(null)},customColor:function(){this.dialog.open()}}),s=e.ui.Widget.extend({init:function(n,i){e.ui.Widget.call(this,n,i),this.element=n,this.color="#000",this.element.addClass("k-spreadsheet-border-palette"),this._borderTypePalette(),this._borderColorPalette(),this.element.on("click",".k-spreadsheet-border-type-palette .k-button",t(this._click.bind(this)))},options:{name:"BorderPalette"},events:["change"],destroy:function(){this.colorChooser.destroy(),this.element.off("click")},_borderTypePalette:function(){var t=r,o=i.map(function(n){return'<a title="'+t[n]+'" href="#" data-border-type="'+n+'" class="k-button k-button-icon"><span class="k-sprite k-font-icon k-icon k-i-'+e.toHyphens(n)+'"></span></a>'}).join(""),s=n("<div />",{"class":"k-spreadsheet-border-type-palette",html:o});s.appendTo(this.element)},_borderColorPalette:function(){var e=n("<div />",{"class":"k-spreadsheet-border-color-palette"});e.appendTo(this.element),this.colorChooser=new o(e,{color:this.color,change:this._colorChange.bind(this)})},_click:function(e){this.type=n(e.currentTarget).data("borderType"),this.trigger("change",{type:this.type,color:this.color})},_colorChange:function(e){this.color=e.value,this.type&&this.trigger("change",{type:this.type,color:this.color})}}),e.spreadsheet.ColorChooser=o,e.spreadsheet.BorderPalette=s)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/toolbar.min",["kendo.toolbar.min","kendo.colorpicker.min","kendo.combobox.min","kendo.dropdownlist.min","kendo.popup.min","spreadsheet/borderpalette.min"],e)}(function(){!function(e){var t,n,i,r,o,s,a,l,u,c,h,d,f,p,m,g,v,b,w,y,_,k,x,C,F,R,S,E,A,M,D,T,B,L,N;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n=e.ui.ToolBar,i=e.spreadsheet.messages.toolbar={addColumnLeft:"Add column left",addColumnRight:"Add column right",addRowAbove:"Add row above",addRowBelow:"Add row below",alignment:"Alignment",alignmentButtons:{justtifyLeft:"Align left",justifyCenter:"Center",justifyRight:"Align right",justifyFull:"Justify",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom"},backgroundColor:"Background",bold:"Bold",borders:"Borders",colorPicker:{reset:"Reset color",customColor:"Custom color..."},copy:"Copy",cut:"Cut",deleteColumn:"Delete column",deleteRow:"Delete row",filter:"Filter",fontFamily:"Font",fontSize:"Font size",format:"Custom format...",formatTypes:{automatic:"Automatic",number:"Number",percent:"Percent",financial:"Financial",currency:"Currency",date:"Date",time:"Time",dateTime:"Date time",duration:"Duration",moreFormats:"More formats..."},formatDecreaseDecimal:"Decrease decimal",formatIncreaseDecimal:"Increase decimal",freeze:"Freeze panes",freezeButtons:{freezePanes:"Freeze panes",freezeRows:"Freeze rows",freezeColumns:"Freeze columns",unfreeze:"Unfreeze panes"},italic:"Italic",merge:"Merge cells",mergeButtons:{mergeCells:"Merge all",mergeHorizontally:"Merge horizontally",mergeVertically:"Merge vertically",unmerge:"Unmerge"},open:"Open...",paste:"Paste",quickAccess:{redo:"Redo",undo:"Undo"},exportAs:"Export...",toggleGridlines:"Toggle gridlines",sortAsc:"Sort ascending",sortDesc:"Sort descending",sortButtons:{sortSheetAsc:"Sort sheet A to Z",sortSheetDesc:"Sort sheet Z to A",sortRangeAsc:"Sort range A to Z",sortRangeDesc:"Sort range Z to A"},textColor:"Text Color",textWrap:"Wrap text",underline:"Underline",validation:"Data validation...",hyperlink:"Link"},r={home:["open","exportAs",["cut","copy","paste"],["bold","italic","underline"],"hyperlink","backgroundColor","textColor","borders","fontSize","fontFamily","alignment","textWrap",["formatDecreaseDecimal","formatIncreaseDecimal"],"format","merge","freeze","filter","toggleGridlines"],insert:[["addColumnLeft","addColumnRight","addRowBelow","addRowAbove"],["deleteColumn","deleteRow"]],data:["sort","filter","validation"]},o={open:{type:"open",overflow:"never",iconClass:"xlsa"},exportAs:{type:"exportAsDialog",dialogName:"exportAs",overflow:"never",text:"",iconClass:"xlsa"},bold:{type:"button",command:"PropertyChangeCommand",property:"bold",value:!0,iconClass:"bold",togglable:!0},italic:{type:"button",command:"PropertyChangeCommand",property:"italic",value:!0,iconClass:"italic",togglable:!0},underline:{type:"button",command:"PropertyChangeCommand",property:"underline",value:!0,iconClass:"underline",togglable:!0},formatDecreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:-1,iconClass:"decrease-decimal"},formatIncreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:1,iconClass:"increase-decimal"},textWrap:{type:"button",command:"TextWrapCommand",property:"wrap",value:!0,iconClass:"text-wrap",togglable:!0},cut:{type:"button",command:"ToolbarCutCommand",iconClass:"cut"},copy:{type:"button",command:"ToolbarCopyCommand",iconClass:"copy"},paste:{type:"button",command:"ToolbarPasteCommand",iconClass:"paste"},separator:{type:"separator"},alignment:{type:"alignment",iconClass:"justify-left"},backgroundColor:{type:"colorPicker",property:"background",iconClass:"background"},textColor:{type:"colorPicker",property:"color",iconClass:"text"},fontFamily:{type:"fontFamily",property:"fontFamily",iconClass:"text"},fontSize:{type:"fontSize",property:"fontSize",iconClass:"font-size"},format:{type:"format",property:"format",iconClass:"format-number"},filter:{type:"filter",property:"hasFilter",iconClass:"filter"},merge:{type:"merge",iconClass:"merge-cells"},freeze:{type:"freeze",iconClass:"freeze-panes"},borders:{type:"borders",iconClass:"all-borders"},formatCells:{type:"dialog",dialogName:"formatCells",overflow:"never"},hyperlink:{type:"dialog",dialogName:"hyperlink",iconClass:"hyperlink",overflow:"never",text:""},toggleGridlines:{type:"button",command:"GridLinesChangeCommand",property:"gridLines",value:!0,iconClass:"no-borders",togglable:!0},addColumnLeft:{type:"button",command:"AddColumnCommand",value:"left",iconClass:"add-column-left"},addColumnRight:{type:"button",command:"AddColumnCommand",value:"right",iconClass:"add-column-right"},addRowBelow:{type:"button",command:"AddRowCommand",value:"below",iconClass:"add-row-below"},addRowAbove:{type:"button",command:"AddRowCommand",value:"above",iconClass:"add-row-above"},deleteColumn:{type:"button",command:"DeleteColumnCommand",iconClass:"delete-column"},deleteRow:{type:"button",command:"DeleteRowCommand",iconClass:"delete-row"},sort:{type:"sort",iconClass:"sort-desc"},validation:{type:"dialog",dialogName:"validation",iconClass:"exception",overflow:"never"}},s=n.extend({init:function(e,t){t.items=this._expandTools(t.tools||s.prototype.options.tools[t.toolbarName]),n.fn.init.call(this,e,t);var i=this._click.bind(this);this.element.addClass("k-spreadsheet-toolbar"),this._addSeparators(this.element),this.bind({click:i,toggle:i})},_addSeparators:function(e){var t=e.children(".k-widget, a.k-button, .k-button-group");t.before("<span class='k-separator' />")},_expandTools:function(e){function n(e){var r=t.isPlainObject(e)?e:o[e]||{},s="k-icon k-font-icon k-i-"+r.iconClass,a=r.type,l={splitButton:{spriteCssClass:s},button:{showText:"overflow"},colorPicker:{toolIcon:s}},u=t.extend({name:r.name||e,text:i[r.name||e],spriteCssClass:s,attributes:{title:i[r.name||e]}},l[a],r);return"splitButton"==a&&(u.menuButtons=u.menuButtons.map(n)),u.attributes["data-tool"]=e,r.property&&(u.attributes["data-property"]=r.property),u}return e.reduce(function(e,i){return e.push(t.isArray(i)?{type:"buttonGroup",buttons:i.map(n)}:n.call(this,i)),e},[])},_click:function(e){var t,n=e.target.attr("data-tool"),i=o[n]||{},r=i.command;r&&(t={command:r,options:{property:i.property||null,value:i.value||null}},"boolean"==typeof t.options.value&&(t.options.value=!!e.checked||null),this.action(t))},events:["click","toggle","open","close","overflowOpen","overflowClose","action","dialog"],options:{name:"SpreadsheetToolBar",resizable:!0,tools:r},action:function(e){this.trigger("action",e)},dialog:function(e){this.trigger("dialog",e)},refresh:function(t){function n(e,t){var n,i=e.toolbar,r=e.overflow,o=i&&i.options.togglable||r&&r.options.togglable;o&&(n=!1,"boolean"==typeof t?n=t:"string"==typeof t&&(n=i.options.value===t),i.toggle(n),r&&r.toggle(n))}function i(e,t){var n=e.toolbar,i=e.overflow;n&&n.update&&n.update(t),i&&i.update&&i.update(t)}var r,o,s,a,l=t,u=this._tools();for(r=0;r<u.length;r++)o=u[r].property,s=u[r].tool,a=e.isFunction(l[o])?l[o]():l,"gridLines"==o&&(a=l.sheet().showGridLines()),"button"===s.type?n(s,a):i(s,a)},_tools:function(){return this.element.find("[data-property]").toArray().map(function(e){return e=t(e),{property:e.attr("data-property"),tool:this._getItem(e)}}.bind(this))},destroy:function(){this.element.find("[data-command],.k-button").each(function(){var e=t(this),n=e.data("instance");n&&n.destroy&&n.destroy()}),n.fn.destroy.call(this)}}),e.spreadsheet.ToolBar=s,a=e.toolbar.Item.extend({init:function(e,n){var i=t("<select />").kendoDropDownList({height:"auto"}).data("kendoDropDownList");this.dropDownList=i,this.element=i.wrapper,this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),i.bind("open",this._open.bind(this)),i.bind("change",this._change.bind(this)),this.element.width(e.width).attr({"data-command":"PropertyChangeCommand","data-property":e.property})},_open:function(){var t,n=this.dropDownList,i=n.list;i.css({whiteSpace:"nowrap",width:"auto"}),t=i.width(),t?t+=20:t=n._listWidth,i.css("width",t+e.support.scrollbar()),n._listWidth=t},_change:function(e){var t=e.sender,n=t.value(),i=t.dataItem(),r=i?i.popup:void 0;r?this.toolbar.dialog({name:r}):this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:"null"==n?null:n}})},value:function(e){return void 0===e?this.dropDownList.value():void this.dropDownList.value(e)}}),l=e.toolbar.Item.extend({init:function(e,n){this.element=t("<a href='#' class='k-button k-button-icon'><span class='"+e.spriteCssClass+"'></span><span class='k-icon k-i-arrow-s'></span></a>"),this.element.on("click touchend",this.open.bind(this)).attr("data-command",e.command),this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this._popup()},destroy:function(){this.popup.destroy()},open:function(e){e.preventDefault(),this.popup.toggle()},_popup:function(){var e=this.element;this.popup=t("<div class='k-spreadsheet-popup' />").appendTo(e).kendoPopup({anchor:e}).data("kendoPopup")}}),e.toolbar.registerComponent("dialog",e.toolbar.ToolBarButton.extend({init:function(t,n){e.toolbar.ToolBarButton.fn.init.call(this,t,n),this._dialogName=t.dialogName,this.element.bind("click touchend",this.open.bind(this)).data("instance",this)},open:function(){this.toolbar.dialog({name:this._dialogName})}})),e.toolbar.registerComponent("exportAsDialog",e.toolbar.Item.extend({init:function(e,n){this._dialogName=e.dialogName,this.toolbar=n,this.element=t("<button class='k-button k-button-icon' title='"+e.attributes.title+"'><span class='k-icon k-font-icon k-i-xls' /></button>").data("instance",this),this.element.bind("click",this.open.bind(this)).data("instance",this)},open:function(){this.toolbar.dialog({name:this._dialogName})}})),u=e.toolbar.OverflowButton.extend({init:function(t,n){e.toolbar.OverflowButton.fn.init.call(this,t,n),this.element.on("click touchend",this._click.bind(this)),this.message=this.options.text;var i=this.element.data("button");this.element.data(this.options.type,i)},_click:t.noop}),c=l.extend({init:function(t,n){l.fn.init.call(this,t,n),this.popup.element.addClass("k-spreadsheet-colorpicker"),this.colorChooser=new e.spreadsheet.ColorChooser(this.popup.element,{change:this._colorChange.bind(this)}),this.element.attr({"data-property":t.property}),this.element.data({type:"colorPicker",colorPicker:this,instance:this})},destroy:function(){this.colorChooser.destroy(),l.fn.destroy.call(this)},update:function(e){this.value(e)},value:function(e){this.colorChooser.value(e)},_colorChange:function(e){this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:e.sender.value()}}),this.popup.close()}}),h=u.extend({init:function(e,t){e.iconName="text",u.fn.init.call(this,e,t)},_click:function(){this.toolbar.dialog({name:"colorPicker",options:{title:this.options.property,property:this.options.property}})}}),e.toolbar.registerComponent("colorPicker",c,h),d=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],f=12,p=e.toolbar.Item.extend({init:function(e,n){var i=t("<input />").kendoComboBox({change:this._valueChange.bind(this),clearButton:!1,dataSource:e.fontSizes||d,value:f}).data("kendoComboBox");this.comboBox=i,this.element=i.wrapper,this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.element.width(e.width).attr({"data-command":"PropertyChangeCommand","data-property":e.property}),this.element.data({type:"fontSize",fontSize:this})},_valueChange:function(t){this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:e.parseInt(t.sender.value())}})},update:function(t){this.value(e.parseInt(t)||f)},value:function(e){return void 0===e?this.comboBox.value():void this.comboBox.value(e)}}),m=u.extend({_click:function(){this.toolbar.dialog({name:"fontSize",options:{sizes:d,defaultSize:f}})},update:function(e){this._value=e||f,this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}}),e.toolbar.registerComponent("fontSize",p,m),g=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],v="Arial",b=a.extend({init:function(e,t){a.fn.init.call(this,e,t);var n=this.dropDownList;n.setDataSource(e.fontFamilies||g),n.value(v),this.element.data({type:"fontFamily",fontFamily:this})},update:function(e){this.value(e||v)}}),w=u.extend({_click:function(){this.toolbar.dialog({name:"fontFamily",options:{fonts:g,defaultFont:v}})},update:function(e){this._value=e||v,this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}}),e.toolbar.registerComponent("fontFamily",b,w),y=e.spreadsheet.formats={automatic:null,number:"#,0.00",percent:"0.00%",financial:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',currency:"$#,##0.00;[Red]$#,##0.00",date:"m/d/yyyy",time:"h:mm:ss AM/PM",dateTime:"m/d/yyyy h:mm",duration:"[h]:mm:ss"},_=a.extend({_revertTitle:function(e){e.sender.value(""),e.sender.wrapper.width("auto")},init:function(e,t){var n,r;a.fn.init.call(this,e,t),n=this.dropDownList,r="<span class='k-icon k-font-icon k-i-"+e.iconClass+"' style='line-height: 1em; width: 1.35em;'></span>",n.bind("change",this._revertTitle.bind(this)),n.bind("dataBound",this._revertTitle.bind(this)),n.setOptions({dataValueField:"format",dataTextField:"name",dataValuePrimitive:!0,valueTemplate:r,template:"# if (data.sample) { #<span class='k-spreadsheet-sample'>#: data.sample #</span># } ##: data.name #"}),n.text(r),n.setDataSource([{format:y.automatic,name:i.formatTypes.automatic},{format:y.number,name:i.formatTypes.number,sample:"1,499.99"},{format:y.percent,name:i.formatTypes.percent,sample:"14.50%"},{format:y.financial,name:i.formatTypes.financial,sample:"(1,000.12)"},{format:y.currency,name:i.formatTypes.currency,sample:"$1,499.99"},{format:y.date,name:i.formatTypes.date,sample:"4/21/2012"},{format:y.time,name:i.formatTypes.time,sample:"5:49:00 PM"},{format:y.dateTime,name:i.formatTypes.dateTime,sample:"4/21/2012 5:49:00"},{format:y.duration,name:i.formatTypes.duration,sample:"168:05:00"},{popup:"formatCells",name:i.formatTypes.moreFormats}]),this.element.data({type:"format",format:this})}}),k=u.extend({_click:function(){this.toolbar.dialog({name:"formatCells"})}}),e.toolbar.registerComponent("format",_,k),x=l.extend({init:function(e,t){l.fn.init.call(this,e,t),this._borderPalette(),this.element.data({type:"borders",instance:this})},destroy:function(){this.borderPalette.destroy(),l.fn.destroy.call(this)},_borderPalette:function(){var n=t("<div />").appendTo(this.popup.element);this.borderPalette=new e.spreadsheet.BorderPalette(n,{change:this._action.bind(this)})},_action:function(e){this.toolbar.action({command:"BorderChangeCommand",options:{border:e.type,style:{size:1,color:e.color}}})}}),C=u.extend({_click:function(){this.toolbar.dialog({name:"borders"})}}),e.toolbar.registerComponent("borders",x,C),F=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this.element.attr({"data-property":"alignment"}),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"alignment",alignment:this,instance:this})},buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:i.alignmentButtons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:i.alignmentButtons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:i.alignmentButtons.justifyRight},{property:"textAlign",value:"justify",iconClass:"justify-full",text:i.alignmentButtons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:i.alignmentButtons.alignTop},{property:"verticalAlign",value:"center",iconClass:"align-middle",text:i.alignmentButtons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:i.alignmentButtons.alignBottom}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},update:function(e){var t=e.textAlign(),n=e.verticalAlign(),i=this.popup.element;i.find(".k-button").removeClass("k-state-active"),t&&i.find("[data-property=textAlign][data-value="+t+"]").addClass("k-state-active"),n&&i.find("[data-property=verticalAlign][data-value="+n+"]").addClass("k-state-active")},_commandPalette:function(){var e=this.buttons,n=t("<div />").appendTo(this.popup.element);e.forEach(function(i,r){var o="<a title='"+i.text+"' data-property='"+i.property+"' data-value='"+i.value+"' class='k-button k-button-icon'><span class='k-icon k-font-icon k-i-"+i.iconClass+"'></span></a>";0!==r&&e[r-1].property!==i.property&&n.append(t("<span class='k-separator' />")),n.append(o)})},_action:function(e){var t=e.attr("data-property"),n=e.attr("data-value");this.toolbar.action({command:"PropertyChangeCommand",options:{property:t,value:n}})}}),R=u.extend({_click:function(){this.toolbar.dialog({name:"alignment"})}}),e.toolbar.registerComponent("alignment",F,R),S=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"merge",merge:this,instance:this})},buttons:[{value:"cells",iconClass:"merge-cells",text:i.mergeButtons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:i.mergeButtons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:i.mergeButtons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:i.mergeButtons.unmerge}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},_commandPalette:function(){var e=t("<div />").appendTo(this.popup.element);this.buttons.forEach(function(t){var n="<a title='"+t.text+"' data-value='"+t.value+"' class='k-button k-button-icontext'><span class='k-icon k-font-icon k-i-"+t.iconClass+"'></span>"+t.text+"</a>";e.append(n)})},_action:function(e){var t=e.attr("data-value");this.toolbar.action({command:"MergeCellCommand",options:{value:t}})}}),E=u.extend({_click:function(){this.toolbar.dialog({name:"merge"})}}),e.toolbar.registerComponent("merge",S,E),A=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"freeze",freeze:this,instance:this})},buttons:[{value:"panes",iconClass:"freeze-panes",text:i.freezeButtons.freezePanes},{value:"rows",iconClass:"freeze-row",text:i.freezeButtons.freezeRows},{value:"columns",iconClass:"freeze-col",text:i.freezeButtons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:i.freezeButtons.unfreeze}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},_commandPalette:function(){var e=t("<div />").appendTo(this.popup.element);this.buttons.forEach(function(t){var n="<a title='"+t.text+"' data-value='"+t.value+"' class='k-button k-button-icontext'><span class='k-icon k-font-icon k-i-"+t.iconClass+"'></span>"+t.text+"</a>";e.append(n)})},_action:function(e){var t=e.attr("data-value");this.toolbar.action({command:"FreezePanesCommand",options:{value:t}})}}),M=u.extend({_click:function(){this.toolbar.dialog({name:"freeze"})}}),e.toolbar.registerComponent("freeze",A,M),D=a.extend({_revertTitle:function(e){e.sender.value(""),e.sender.wrapper.width("auto")},init:function(e,t){a.fn.init.call(this,e,t);var n=this.dropDownList;n.bind("change",this._revertTitle.bind(this)),n.bind("dataBound",this._revertTitle.bind(this)),n.setOptions({valueTemplate:"<span class='k-icon k-font-icon k-i-"+e.iconClass+"' style='line-height: 1em; width: 1.35em;'></span>",template:"<span class='k-icon k-font-icon k-i-#= iconClass #' style='line-height: 1em; width: 1.35em;'></span>#=text#",dataTextField:"text",dataValueField:"value"}),n.setDataSource([{value:"asc",sheet:!1,text:i.sortButtons.sortRangeAsc,iconClass:"sort-asc"},{value:"desc",sheet:!1,text:i.sortButtons.sortRangeDesc,iconClass:"sort-desc"}]),n.select(0),this.element.data({type:"sort",sort:this})},_change:function(e){var t=e.sender,n=t.dataItem();n&&this.toolbar.action({command:"SortCommand",options:{value:n.value,sheet:n.sheet}})},value:t.noop}),T=u.extend({_click:function(){this.toolbar.dialog({name:"sort"})}}),e.toolbar.registerComponent("sort",D,T),B=e.toolbar.ToolBarButton.extend({init:function(t,n){t.showText="overflow",e.toolbar.ToolBarButton.fn.init.call(this,t,n),this.element.on("click",this._click.bind(this)),this.element.data({type:"filter",filter:this})},_click:function(){this.toolbar.action({command:"FilterCommand"})},update:function(e){this.toggle(e)}}),L=u.extend({init:function(e,t){u.fn.init.call(this,e,t),this.element.data({type:"filter",filter:this})},_click:function(){this.toolbar.action({command:"FilterCommand"})},update:function(e){this.toggle(e)}}),e.toolbar.registerComponent("filter",B,L),N=e.toolbar.Item.extend({init:function(e,n){this.toolbar=n,this.element=t("<div class='k-button k-upload-button k-button-icon'><span class='k-icon k-font-icon k-i-folder-open' /></div>").data("instance",this),this._title=e.attributes.title,this._reset()},_reset:function(){this.element.remove("input"),t("<input type='file' autocomplete='off' accept='.xlsx'/>").attr("title",this._title).one("change",this._change.bind(this)).appendTo(this.element)},_change:function(e){this.toolbar.action({command:"OpenCommand",options:{file:e.target.files[0]}}),this._reset()}}),e.toolbar.registerComponent("open",N),e.spreadsheet.TabStrip=e.ui.TabStrip.extend({init:function(n,i){e.ui.TabStrip.fn.init.call(this,n,i),n.addClass("k-spreadsheet-tabstrip"),this._quickAccessButtons(),this.toolbars={};var r=i.dataSource;this.contentElements.each(function(e,n){this._toolbar(t(n),r[e].id,i.toolbarOptions[r[e].id])}.bind(this)),this.one("activate",function(){this.toolbars[this.options.dataSource[0].id].resize()})},events:e.ui.TabStrip.fn.events.concat(["action","dialog"]),destroy:function(){this.quickAccessToolBar.off("click"),e.ui.TabStrip.fn.destroy.call(this);for(var t in this.toolbars)this.toolbars[t].destroy()},action:function(e){this.trigger("action",e)},dialog:function(e){this.trigger("dialog",e)},refreshTools:function(e){var t,n=this.toolbars;for(t in n)n.hasOwnProperty(t)&&n[t].refresh(e)},_quickAccessButtons:function(){var n=[{title:i.quickAccess.undo,iconClass:"undo-large",action:"undo"},{title:i.quickAccess.redo,iconClass:"redo-large",action:"redo"}],r=e.template("<a href='\\#' title='#= title #' data-action='#= action #' class='k-button k-button-icon'><span class='k-icon k-font-icon k-i-#=iconClass#'></span></a>");this.quickAccessToolBar=t("<div />",{"class":"k-spreadsheet-quick-access-toolbar",html:e.render(r,n)}).insertBefore(this.wrapper),this.quickAccessToolBar.on("click",".k-button",function(e){e.preventDefault();var n=t(e.currentTarget).attr("data-action");this.action({action:n})}.bind(this)),this.quickAccessAdjust()},quickAccessAdjust:function(){this.tabGroup.css("padding-left",e._outerWidth(this.quickAccessToolBar))},_toolbar:function(t,n,i){var r,o;this.toolbars[n]&&(this.toolbars[n].destroy(),t.children(".k-toolbar").remove()),i&&(r=t.html("<div />").children("div"),o={tools:"boolean"==typeof i?void 0:i,toolbarName:n,action:this.action.bind(this),dialog:this.dialog.bind(this)},this.toolbars[n]=new e.spreadsheet.ToolBar(r,o))}}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/dialogs.min",["kendo.core.min","kendo.binder.min","kendo.validator.min"],e)}(function(){!function(e){function t(t,n){return e.spreadsheet.formatting.text(t,n)}function n(e,t){var n,i=[],o=[];for(n=0;n<t.length;n++)r.inArray(t[n][e],o)==-1&&(i.push(t[n]),o.push(t[n][e]));return i}function i(t,n){e.spreadsheet.dialogs.register(t,h.extend({options:{messageId:n}}))}var r,o,s,a,l,u,c,h,d,f,p,m,g,v,b,w,y,_,k,x,C,F,R;e.support.browser.msie&&e.support.browser.version<9||(r=e.jQuery,o=e.data.ObservableObject,s=e.spreadsheet.messages.dialogs={apply:"Apply",save:"Save",cancel:"Cancel",remove:"Remove",retry:"Retry",revert:"Revert",okText:"OK",formatCellsDialog:{title:"Format",categories:{number:"Number",currency:"Currency",date:"Date"}},fontFamilyDialog:{title:"Font"},fontSizeDialog:{title:"Font size"},bordersDialog:{title:"Borders"},alignmentDialog:{title:"Alignment",buttons:{justtifyLeft:"Align left",justifyCenter:"Center",justifyRight:"Align right",justifyFull:"Justify",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom"}},mergeDialog:{title:"Merge cells",buttons:{mergeCells:"Merge all",mergeHorizontally:"Merge horizontally",mergeVertically:"Merge vertically",unmerge:"Unmerge"}},freezeDialog:{title:"Freeze panes",buttons:{freezePanes:"Freeze panes",freezeRows:"Freeze rows",freezeColumns:"Freeze columns",unfreeze:"Unfreeze panes"}},validationDialog:{title:"Data Validation",hintMessage:"Please enter a valid {0} value {1}.",hintTitle:"Validation {0}",criteria:{any:"Any value",number:"Number",text:"Text",date:"Date",custom:"Custom Formula",list:"List"},comparers:{greaterThan:"greater than",lessThan:"less than",between:"between",notBetween:"not between",equalTo:"equal to",notEqualTo:"not equal to",greaterThanOrEqualTo:"greater than or equal to",lessThanOrEqualTo:"less than or equal to"},comparerMessages:{greaterThan:"greater than {0}",lessThan:"less than {0}",between:"between {0} and {1}",notBetween:"not between {0} and {1}",equalTo:"equal to {0}",notEqualTo:"not equal to {0}",greaterThanOrEqualTo:"greater than or equal to {0}",lessThanOrEqualTo:"less than or equal to {0}",custom:"that satisfies the formula: {0}"},labels:{criteria:"Criteria",comparer:"Comparer",min:"Min",max:"Max",value:"Value",start:"Start",end:"End",onInvalidData:"On invalid data",rejectInput:"Reject input",showWarning:"Show warning",showHint:"Show hint",hintTitle:"Hint title",hintMessage:"Hint message",ignoreBlank:"Ignore blank",showListButton:"Display button to show list",showCalendarButton:"Display button to show calendar"},placeholders:{typeTitle:"Type title",typeMessage:"Type message"}},exportAsDialog:{title:"Export...",labels:{scale:"Scale",fit:"Fit to page",fileName:"File name",saveAsType:"Save as type",exportArea:"Export",paperSize:"Paper size",margins:"Margins",orientation:"Orientation",print:"Print",guidelines:"Guidelines",center:"Center",horizontally:"Horizontally",vertically:"Vertically"}},modifyMergedDialog:{errorMessage:"Cannot change part of a merged cell."},rangeDisabledDialog:{errorMessage:"Destination range contains disabled cells."},incompatibleRangesDialog:{errorMessage:"Incompatible ranges"},noFillDirectionDialog:{errorMessage:"Cannot determine fill direction"},duplicateSheetNameDialog:{errorMessage:"Duplicate sheet name"},overflowDialog:{errorMessage:"Cannot paste, because the copy area and the paste area are not the same size and shape."},useKeyboardDialog:{title:"Copying and pasting",errorMessage:"These actions cannot be invoked through the menu. Please use the keyboard shortcuts instead:",labels:{forCopy:"for copy",forCut:"for cut",forPaste:"for paste"}},unsupportedSelectionDialog:{errorMessage:"That action cannot be performed on multiple selection."},linkDialog:{title:"Hyperlink",labels:{text:"Text",url:"Address",removeLink:"Remove link"}}},a={},e.spreadsheet.dialogs={register:function(e,t){a[e]=t},registered:function(e){return!!a[e]},create:function(e,t){var n=a[e];if(n)return new n(t)}},l=e.spreadsheet.SpreadsheetDialog=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this,t),this.options=r.extend(!0,{},this.options,t),this.bind(this.events,t)},events:["close","activate"],options:{autoFocus:!0},dialog:function(){return this._dialog||(this._dialog=r("<div class='k-spreadsheet-window k-action-window' />").addClass(this.options.className||"").append(e.template(this.options.template)({messages:e.spreadsheet.messages.dialogs||s})).appendTo(document.body).kendoWindow({autoFocus:this.options.autoFocus,scrollable:!1,resizable:!1,modal:!0,visible:!1,width:this.options.width||320,title:this.options.title,open:function(){this.center()},close:this._onDialogClose.bind(this),activate:this._onDialogActivate.bind(this),deactivate:this._onDialogDeactivate.bind(this)}).data("kendoWindow")),this._dialog},_onDialogClose:function(){this.trigger("close",{action:this._action})},_onDialogActivate:function(){this.trigger("activate")},_onDialogDeactivate:function(){this.trigger("deactivate"),this.destroy()},destroy:function(){this._dialog&&(this._dialog.destroy(),this._dialog=null)},open:function(){this.dialog().open()},apply:function(){this.close()},close:function(){this._action="close",this.dialog().close()}}),u=e.spreadsheet.FormatCellsViewModel=o.extend({init:function(e){o.fn.init.call(this,e),this.useCategory(this.category)},useCategory:function(e){var t=e&&e.type||"number",n="currency"==t;this.category=e,this.set("showCurrencyFilter",n&&this.currencies.length>1),n?this.currency(this.currencies[0]):this.set("formats",this.allFormats[t+"Formats"]),
this.useFirstFormat()},useFirstFormat:function(){this.formats.length&&this.set("format",this.formats[0].value)},currency:function(e){var n,i;return void 0!==e&&(this._currency=e,n=e.value,i=[{currency:n,decimals:!0},{currency:n,decimals:!0,iso:!0},{currency:n,decimals:!1}],i=i.map(function(e){return e=u.convert.currency(e),{value:e,name:t(1e3,e)}}),this.set("formats",i),this.useFirstFormat()),this._currency||this.currencies[0]},categoryFilter:function(e){return void 0!==e&&this.useCategory(e),this.category},preview:function(){var e=this.get("format"),n=this.value||0;return e&&e.length?t(n,e):n}}),u.convert={currency:function(e){function t(e,t){return Array(t+1).join(e)}var n=e.currency,i=n.pattern[1];return e.decimals&&(i=i.replace(/n/g,"n"+n["."]+t("0",n.decimals))),i=e.iso?'"'+n.abbr+'" '+i.replace(/\s*\$\s*/g,""):i.replace(/\$/g,n.symbol),i=i.replace(/n/g,"?")},date:function(e){return/T|Z/.test(e)?"":e.toLowerCase().replace(/tt/g,"AM/PM").replace(/'/g,'"')}},c=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.formatCellsDialog||s,i={title:n.title,categories:[{type:"number",name:n.categories.number},{type:"currency",name:n.categories.currency},{type:"date",name:n.categories.date}]};l.fn.init.call(this,r.extend(i,t)),this._generateFormats()},options:{className:"k-spreadsheet-format-cells",template:"<div class='k-root-tabs' data-role='tabstrip' data-text-field='name' data-bind='source: categories, value: categoryFilter' data-animation='false' /><div class='k-spreadsheet-preview' data-bind='text: preview' /><script type='text/x-kendo-template' id='format-item-template'>\\#: data.name \\#</script><select data-role='dropdownlist' class='k-format-filter' data-text-field='description' data-value-field='value.name' data-bind='visible: showCurrencyFilter, value: currency, source: currencies' /><ul data-role='staticlist' tabindex='0' class='k-list k-reset' data-template='format-item-template' data-value-primitive='true' data-value-field='value' data-bind='source: formats, value: format' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.apply #</button><button class='k-button' data-bind='click: close'>#: messages.cancel #</button></div>"},_generateFormats:function(){var i,o=this.options;o.currencies||(o.currencies=c.currenciesFrom(e.cultures)),o.numberFormats||(o.numberFormats=[{value:"#.00%",name:"100.00%"},{value:"#%",name:"100%"},{value:"#.00",name:"1024.00"},{value:"#,###.00",name:"1,024.00"}]),o.dateFormats||(i=e.cultures.current.calendars.standard.patterns,o.dateFormats=n("value",r.map(i,function(e){if(e=u.convert.date(e))return{value:e,name:t(34567.7678,e)}})))},open:function(t){var n,i,r=this.options,o=t.value(),s=r.categories.slice(0);this.viewModel=new u({currencies:r.currencies.slice(0),allFormats:{numberFormats:r.numberFormats.slice(0),dateFormats:r.dateFormats.slice(0)},categories:s,format:t.format(),category:o instanceof Date?s[2]:s[0],apply:this.apply.bind(this),close:this.close.bind(this),value:o}),l.fn.open.call(this),n=this.dialog().element,e.bind(n,this.viewModel),i=n.find("select.k-format-filter").data("kendoDropDownList"),r.currencies.length>10&&i.setOptions({filter:"contains"}),n.find(e.roleSelector("staticlist")).parent().addClass("k-list-wrapper")},apply:function(){var e=this.viewModel.format;l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"format",value:e}})}}),c.currenciesFrom=function(t){return n("description",r.map(t,function(t,n){var i,r;if(/-/.test(n))return i=t.numberFormat.currency,r=e.format("{0} ({1}, {2})",i.name,i.abbr,i.symbol),{description:r,value:i}}))},e.spreadsheet.dialogs.register("formatCells",c),e.spreadsheet.dialogs.FormatCellsDialog=c,h=l.extend({options:{className:"k-spreadsheet-message",title:"",messageId:"",text:"",template:"<div class='k-spreadsheet-message-content' data-bind='text: text' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: close'>#= messages.okText #</button></div>"},open:function(){var t,n;l.fn.open.call(this),t=this.options,n=t.text,t.messageId&&(n=e.getter(t.messageId,!0)(e.spreadsheet.messages.dialogs)),e.bind(this.dialog().element,{text:n,close:this.close.bind(this)})}}),e.spreadsheet.dialogs.register("message",h),d=l.extend({options:{className:"k-spreadsheet-message",title:"",messageId:"",text:"",template:"<div class='k-spreadsheet-message-content' data-bind='text: text' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: close'>#= messages.retry #</button><button class='k-button' data-bind='click: revert'>#= messages.revert #</button></div>"},open:function(){var t,n;l.fn.open.call(this),t=this.options,n=t.text,t.messageId&&(n=e.getter(t.messageId,!0)(e.spreadsheet.messages.dialogs)),e.bind(this.dialog().element,{text:n,close:this.close.bind(this),revert:this.revert.bind(this)})},activate:function(e){e.sender.dialog().element.find(".k-button").focus()},revert:function(){this._action="revert",this.dialog().close()}}),e.spreadsheet.dialogs.register("validationError",d),f=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.fontFamilyDialog||s;l.fn.init.call(this,r.extend({title:n.title},t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul"),n=this.options.fonts,i=this.options.defaultFont;this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:n}),template:"#: data #",value:i,change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontFamily",value:e.sender.value()[0]}})}}),e.spreadsheet.dialogs.register("fontFamily",f),p=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.fontSizeDialog||s;l.fn.init.call(this,r.extend({title:n.title},t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul"),n=this.options.sizes,i=this.options.defaultSize;this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:n}),template:"#: data #",value:i,change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(t){l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontSize",value:e.parseInt(t.sender.value()[0])}})}}),e.spreadsheet.dialogs.register("fontSize",p),m=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.bordersDialog||s;l.fn.init.call(this,r.extend({title:n.title},t)),this.element=this.dialog().element,this._borderPalette(),this.viewModel=e.observable({apply:this.apply.bind(this),close:this.close.bind(this)}),e.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{width:177,template:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.apply #</button><button class='k-button' data-bind='click: close'>#: messages.cancel #</button></div>"},apply:function(){l.fn.apply.call(this);var e=this.value();this.trigger("action",{command:"BorderChangeCommand",options:{border:e.type,style:{size:1,color:e.color}}})},_borderPalette:function(){var t=this.dialog().element.find("div:first");this.borderPalette=new e.spreadsheet.BorderPalette(t,{change:this.value.bind(this)})},value:function(e){return void 0===e?this._state:void(this._state=e)}}),e.spreadsheet.dialogs.register("borders",m),g=l.extend({init:function(t){l.fn.init.call(this,t),this.element=this.dialog().element,this.property=t.property,this.options.title=t.title,this.viewModel=e.observable({apply:this.apply.bind(this),close:this.close.bind(this)}),e.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{template:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.apply #</button><button class='k-button' data-bind='click: close'>#: messages.cancel #</button></div>"},apply:function(){l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:this.property,value:this.value()}})},value:function(e){return void 0===e?this._value:void(this._value=e.value)}}),v=g.extend({init:function(e){e.width=177,g.fn.init.call(this,e),this._colorPalette()},_colorPalette:function(){var e=this.dialog().element.find("div:first");this.colorPalette=e.kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],change:this.value.bind(this)}).data("kendoColorPalette")}}),e.spreadsheet.dialogs.register("colorPicker",v),b=g.extend({init:function(e){e.width=268,g.fn.init.call(this,e),this.dialog().setOptions({animation:!1}),this.dialog().one("activate",this._colorPicker.bind(this))},_colorPicker:function(){var e=this.dialog().element.find("div:first");this.colorPicker=e.kendoFlatColorPicker({change:this.value.bind(this)}).data("kendoFlatColorPicker")}}),e.spreadsheet.dialogs.register("customColor",b),w=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.alignmentDialog||s,i={title:n.title,buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:n.buttons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:n.buttons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:n.buttons.justifyRight},{property:"textAlign",value:"justify",iconClass:"justify-full",text:n.buttons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:n.buttons.alignTop},{property:"verticalAlign",value:"center",iconClass:"align-middle",text:n.buttons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:n.buttons.alignBottom}]};l.fn.init.call(this,r.extend(i,t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-property='#=property#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:t.property,value:t.value}})}}),e.spreadsheet.dialogs.register("alignment",w),y=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.mergeDialog||s,i={title:n.title,buttons:[{value:"cells",iconClass:"merge-cells",text:n.buttons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:n.buttons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:n.buttons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:n.buttons.unmerge}]};l.fn.init.call(this,r.extend(i,t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];l.fn.apply.call(this),this.trigger("action",{command:"MergeCellCommand",options:{value:t.value}})}}),e.spreadsheet.dialogs.register("merge",y),_=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.freezeDialog||s,i={title:n.title,buttons:[{value:"panes",iconClass:"freeze-panes",text:n.buttons.freezePanes},{value:"rows",iconClass:"freeze-row",text:n.buttons.freezeRows},{value:"columns",iconClass:"freeze-col",text:n.buttons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:n.buttons.unfreeze}]};l.fn.init.call(this,r.extend(i,t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];l.fn.apply.call(this),this.trigger("action",{command:"FreezePanesCommand",options:{value:t.value}})}}),e.spreadsheet.dialogs.register("freeze",_),k=e.spreadsheet.ValidationCellsViewModel=o.extend({init:function(e){o.fn.init.call(this,e),this.bind("change",function(e){"criterion"===e.field&&(this.reset(),"custom"!==this.criterion&&"list"!==this.criterion||this.setHintMessageTemplate()),"comparer"===e.field&&this.setHintMessageTemplate(),"hintMessage"!=e.field&&"hintTitle"!=e.field||this._mute||(this.shouldBuild=!1),"from"!=e.field&&"to"!=e.field&&"hintMessageTemplate"!=e.field&&"type"!=e.field||!this.shouldBuild||this.buildMessages()}.bind(this)),this.reset()},buildMessages:function(){this._mute=!0,this.set("hintTitle",this.hintTitleTemplate?e.format(this.hintTitleTemplate,this.type):""),this.set("hintMessage",this.hintMessageTemplate?e.format(this.hintMessageTemplate,this.from,this.to):""),this._mute=!1},reset:function(){this.setComparers(),this.set("comparer",this.comparers[0].type),this.set("from",null),this.set("to",null),this.set("useCustomMessages",!1),this.shouldBuild=!0,this.hintTitleTemplate=this.defaultHintTitle,this.buildMessages()},setComparers:function(){var e,t,n=this.defaultComparers,i=[];if("text"===this.criterion)for(e=["equalTo","notEqualTo"],t=0;t<n.length;t++)e[0]==n[t].type&&(i.push(n[t]),e.shift());else i=n.slice();this.set("comparers",i)},setHintMessageTemplate:function(){"custom"!==this.criterion&&"list"!==this.criterion?this.set("hintMessageTemplate",e.format(this.defaultHintMessage,this.criterion,this.comparerMessages[this.comparer])):(this.set("hintMessageTemplate",""),this.set("hintMessage",""))},isAny:function(){return"any"===this.get("criterion")},isNumber:function(){return"number"===this.get("criterion")},showToForNumber:function(){return this.showTo()&&this.isNumber()},showToForDate:function(){return this.showTo()&&this.isDate()},isText:function(){return"text"===this.get("criterion")},isDate:function(){return"date"===this.get("criterion")},isList:function(){return"list"===this.get("criterion")},isCustom:function(){return"custom"===this.get("criterion")},showRemove:function(){return this.get("hasValidation")},showTo:function(){return"between"==this.get("comparer")||"notBetween"==this.get("comparer")},update:function(e){this.set("hasValidation",!!e),e&&this.fromValidationObject(e)},fromValidationObject:function(e){this.set("criterion",e.dataType),this.set("comparer",e.comparerType),this.set("from",e.from),this.set("to",e.to),this.set("type",e.type),this.set("ignoreBlank",e.allowNulls),this.set("showButton",e.showButton),e.messageTemplate||e.titleTemplate?(this.hintMessageTemplate=e.messageTemplate,this.hintMessage=e.messageTemplate,this.hintTitleTemplate=e.titleTemplate,this.hintTitle=e.titleTemplate,this.useCustomMessages=!0,this.buildMessages()):this.useCustomMessages=!1},toValidationObject:function(){if("any"===this.criterion)return null;var e={type:this.type,dataType:this.criterion,comparerType:this.comparer,from:this.from,to:this.to,allowNulls:this.ignoreBlank,showButton:this.showButton};return this.useCustomMessages&&(e.messageTemplate=this.shouldBuild?this.hintMessageTemplate:this.hintMessage,e.titleTemplate=this.hintTitle),e}}),x=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.validationDialog||s,i={title:n.title,hintMessage:n.hintMessage,hintTitle:n.hintTitle,criteria:[{type:"any",name:n.criteria.any},{type:"number",name:n.criteria.number},{type:"text",name:n.criteria.text},{type:"date",name:n.criteria.date},{type:"custom",name:n.criteria.custom},{type:"list",name:n.criteria.list}],comparers:[{type:"greaterThan",name:n.comparers.greaterThan},{type:"lessThan",name:n.comparers.lessThan},{type:"between",name:n.comparers.between},{type:"notBetween",name:n.comparers.notBetween},{type:"equalTo",name:n.comparers.equalTo},{type:"notEqualTo",name:n.comparers.notEqualTo},{type:"greaterThanOrEqualTo",name:n.comparers.greaterThanOrEqualTo},{type:"lessThanOrEqualTo",name:n.comparers.lessThanOrEqualTo}],comparerMessages:n.comparerMessages};l.fn.init.call(this,r.extend(i,t))},options:{width:450,criterion:"any",type:"reject",ignoreBlank:!0,showButton:!0,useCustomMessages:!1,errorTemplate:'<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-i-warning"> </span>#= message #<div class="k-callout k-callout-n"></div></div>',template:'<div class="k-edit-form-container"><div class="k-edit-label"><label>#: messages.validationDialog.labels.criteria #:</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: criterion, source: criteria" /></div><div data-bind="visible: isNumber"><div class="k-edit-label"><label>#: messages.validationDialog.labels.comparer #:</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.min #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.min #" placeholder="e.g. 10" class="k-textbox" data-bind="value: from, enabled: isNumber" required="required" /></div><div data-bind="visible: showTo"><div class="k-edit-label"><label>#: messages.validationDialog.labels.max #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.max #" placeholder="e.g. 100" class="k-textbox" data-bind="value: to, enabled: showToForNumber" required="required" /></div></div></div><div data-bind="visible: isText"><div class="k-edit-label"><label>#: messages.validationDialog.labels.comparer #:</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isText" required="required" /></div></div><div data-bind="visible: isDate"><div class="k-edit-label"><label>#: messages.validationDialog.labels.comparer #:</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.start #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.start #" class="k-textbox" data-bind="value: from, enabled: isDate" required="required" /></div><div data-bind="visible: showTo"><div class="k-edit-label"><label>#: messages.validationDialog.labels.end #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.end #" class="k-textbox" data-bind="value: to, enabled: showToForDate" required="required" /></div></div></div><div data-bind="visible: isCustom"><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isCustom" required="required" /></div></div><div data-bind="visible: isList"><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isList" required="required" /></div></div><div data-bind="visible: isList"><div class="k-edit-field"><input type="checkbox" name="showButton" id="showButton" class="k-checkbox" data-bind="checked: showButton"/><label for="showButton" class="k-checkbox-label"> #: messages.validationDialog.labels.showListButton #</label></div></div><div data-bind="visible: isDate"><div class="k-edit-field"><input type="checkbox" name="showButton" id="showButton" class="k-checkbox" data-bind="checked: showButton"/><label for="showButton" class="k-checkbox-label"> #: messages.validationDialog.labels.showCalendarButton #</label></div></div><div data-bind="invisible: isAny"><div class="k-edit-field"><input type="checkbox" name="ignoreBlank" id="ignoreBlank" class="k-checkbox" data-bind="checked: ignoreBlank"/><label for="ignoreBlank" class="k-checkbox-label"> #: messages.validationDialog.labels.ignoreBlank #</label></div></div><div data-bind="invisible: isAny"><div class="k-action-buttons"></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.onInvalidData #:</label></div><div class="k-edit-field"><input type="radio" id="validationTypeReject" name="validationType" value="reject" data-bind="checked: type" class="k-radio" /><label for="validationTypeReject" class="k-radio-label">#: messages.validationDialog.labels.rejectInput #</label> <input type="radio" id="validationTypeWarning" name="validationType" value="warning" data-bind="checked: type" class="k-radio" /><label for="validationTypeWarning" class="k-radio-label">#: messages.validationDialog.labels.showWarning #</label></div></div><div data-bind="invisible: isAny" class="hint-wrapper"><div class="k-edit-field"><input type="checkbox" name="useCustomMessages" id="useCustomMessages" class="k-checkbox" data-bind="checked: useCustomMessages" /><label class="k-checkbox-label" for="useCustomMessages"> #: messages.validationDialog.labels.showHint #</label></div><div data-bind="visible: useCustomMessages"><div class="k-edit-label"><label>#: messages.validationDialog.labels.hintTitle #:</label></div><div class="k-edit-field"><input class="k-textbox" placeholder="#: messages.validationDialog.placeholders.typeTitle #" data-bind="value: hintTitle" /></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.hintMessage #:</label></div><div class="k-edit-field"><input class="k-textbox" placeholder="#: messages.validationDialog.placeholders.typeMessage #" data-bind="value: hintMessage" /></div></div></div><div class="k-action-buttons"><button class="k-button" data-bind="visible: showRemove, click: remove">#: messages.remove #</button><button class="k-button k-primary" data-bind="click: apply">#: messages.apply #</button><button class="k-button" data-bind="click: close">#: messages.cancel #</button></div></div>'},open:function(t){var n,i=this.options;this.viewModel=new k({type:i.type,defaultHintMessage:i.hintMessage,defaultHintTitle:i.hintTitle,defaultComparers:i.comparers.slice(0),comparerMessages:i.comparerMessages,criteria:i.criteria.slice(0),criterion:i.criterion,ignoreBlank:i.ignoreBlank,showButton:i.showButton,apply:this.apply.bind(this),close:this.close.bind(this),remove:this.remove.bind(this)}),this.viewModel.update(t.validation()),l.fn.open.call(this),n=this.dialog().element,this.validatable&&this.validatable.destroy(),e.bind(n,this.viewModel),this.validatable=new e.ui.Validator(n.find(".k-edit-form-container"),{validateOnBlur:!1,errorTemplate:this.options.errorTemplate||void 0})},apply:function(){this.validatable.validate()&&(l.fn.apply.call(this),this.trigger("action",{command:"EditValidationCommand",options:{value:this.viewModel.toValidationObject()}}))},remove:function(){this.viewModel.set("criterion","any"),this.apply()}}),e.spreadsheet.dialogs.register("validation",x),e.spreadsheet.dialogs.ValidationDialog=x,C=l.extend({init:function(t){var n,i=e.spreadsheet.messages.dialogs.exportAsDialog||s;l.fn.init.call(this,r.extend({title:i.title},t)),this.viewModel=e.observable({title:this.options.title,name:this.options.name,extension:this.options.extension,fileFormats:this.options.fileFormats,excel:t.excelExport,pdf:{proxyURL:t.pdfExport.proxyURL,forceProxy:t.pdfExport.forceProxy,title:t.pdfExport.title,author:t.pdfExport.author,subject:t.pdfExport.subject,keywords:t.pdfExport.keywords,creator:t.pdfExport.creator,date:t.pdfExport.date,fitWidth:this.options.pdf.fitWidth,area:this.options.pdf.area,areas:this.options.pdf.areas,paperSize:this.options.pdf.paperSize,paperSizes:this.options.pdf.paperSizes,margin:this.options.pdf.margin,margins:this.options.pdf.margins,landscape:this.options.pdf.landscape,guidelines:this.options.pdf.guidelines,hCenter:this.options.pdf.hCenter,vCenter:this.options.pdf.vCenter},apply:this.apply.bind(this),close:this.close.bind(this)}),n=this.dialog(),this.viewModel.bind("change",function(e){"extension"===e.field&&(this.set("showPdfOptions",".pdf"===this.extension),n.center())}),e.bind(n.element,this.viewModel)},options:{name:"Workbook",extension:".xlsx",fileFormats:[{description:"Excel Workbook (.xlsx)",extension:".xlsx"},{description:"Portable Document Format(.pdf)",extension:".pdf"}],pdf:{fitWidth:!0,area:"workbook",areas:[{area:"workbook",text:"Entire Workbook"},{area:"sheet",text:"Active Sheet"},{area:"selection",text:"Selection"}],paperSize:"a4",paperSizes:[{value:"a2",text:"A2 (420 mm × 594 mm)     "},{value:"a3",text:"A3 (297 mm x 420 mm)     "},{value:"a4",text:"A4 (210 mm x 297 mm)     "},{value:"a5",text:"A5 (148 mm x 210 mm)     "},{value:"b3",text:"B3 (353 mm × 500 mm)     "},{value:"b4",text:"B4 (250 mm x 353 mm)     "},{value:"b5",text:"B5 (176 mm x 250 mm)     "},{value:"folio",text:'Folio (8.5" x 13")       '},{value:"legal",text:'Legal (8.5" x 14")       '},{value:"letter",text:'Letter (8.5" x 11")      '},{value:"tabloid",text:'Tabloid (11" x 17")      '},{value:"executive",text:'Executive (7.25" x 10.5")'}],margin:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},margins:[{value:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},text:"Normal"},{value:{bottom:"0.75in",left:"0.25in",right:"0.25in",top:"0.75in"},text:"Narrow"},{value:{bottom:"1in",left:"1in",right:"1in",top:"1in"},text:"Wide"}],landscape:!0,guidelines:!0,hCenter:!0,vCenter:!0},width:520,template:"<div class='k-edit-label'><label>#: messages.exportAsDialog.labels.fileName #:</label></div><div class='k-edit-field'><input class='k-textbox' data-bind='value: name' /></div><div ><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.saveAsType #:</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='description' data-value-field='extension' data-bind='value: extension, source: fileFormats' /></div></div><div class='export-config' data-bind='visible: showPdfOptions'><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.exportArea #:</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='text' data-value-field='area' data-bind='value: pdf.area, source: pdf.areas' /></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.paperSize#:</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='text' data-value-field='value' data-bind='value: pdf.paperSize, source: pdf.paperSizes' /></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.margins #:</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-value-primitive='true'data-text-field='text' data-value-field='value' data-bind='value: pdf.margin, source: pdf.margins' /></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.orientation #:</label></div><div class='k-edit-field'><input type='radio' id='k-orientation-portrait' name='orientation' data-type='boolean' data-bind='checked: pdf.landscape' value='false' /><label class='k-orientation-label k-orientation-portrait-label' for='k-orientation-portrait'></label><input type='radio' id='k-orientation-landscape' name='orientation' data-type='boolean' data-bind='checked: pdf.landscape' value='true' /><label class='k-orientation-label k-orientation-landscape-label' for='k-orientation-landscape'></label></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.print #:</label></div><div class='k-edit-field'><input class='k-checkbox' id='guidelines' type='checkbox' data-bind='checked: pdf.guidelines'/><label class='k-checkbox-label' for='guidelines'>#: messages.exportAsDialog.labels.guidelines#</label></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.scale #:</label></div><div class='k-edit-field'><input class='k-checkbox' id='fitWidth' type='checkbox' data-bind='checked: pdf.fitWidth'/><label class='k-checkbox-label' for='fitWidth'>#: messages.exportAsDialog.labels.fit #</label></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.center #:</label></div><div class='k-edit-field'><input class='k-checkbox' id='hCenter' type='checkbox' data-bind='checked: pdf.hCenter'/><label class='k-checkbox-label' for='hCenter'>#: messages.exportAsDialog.labels.horizontally #</label><input class='k-checkbox' id='vCenter' type='checkbox' data-bind='checked: pdf.vCenter'/><label class='k-checkbox-label' for='vCenter'>#: messages.exportAsDialog.labels.vertically #</label></div><div class='k-page-orientation' data-bind='css: {k-page-landscape: pdf.landscape}'><div class='k-margins-horizontal'></div><div class='k-margins-vertical'></div></div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.save #</button><button class='k-button' data-bind='click: close'>#: messages.cancel #</button></div>"},apply:function(){l.fn.apply.call(this),this.trigger("action",{command:"SaveAsCommand",options:this.viewModel})}}),e.spreadsheet.dialogs.register("exportAs",C),i("modifyMerged","modifyMergedDialog.errorMessage"),i("rangeDisabled","rangeDisabledDialog.errorMessage"),i("overflow","overflowDialog.errorMessage"),i("unsupportedSelection","unsupportedSelectionDialog.errorMessage"),i("incompatibleRanges","incompatibleRangesDialog.errorMessage"),i("noFillDirection","noFillDirectionDialog.errorMessage"),i("duplicateSheetName","duplicateSheetNameDialog.errorMessage"),F=h.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.useKeyboardDialog||s;l.fn.init.call(this,r.extend({title:n.title},t))},options:{template:"#: messages.useKeyboardDialog.errorMessage #<div>Ctrl+C #: messages.useKeyboardDialog.labels.forCopy #</div><div>Ctrl+X #: messages.useKeyboardDialog.labels.forCut #</div><div>Ctrl+V #: messages.useKeyboardDialog.labels.forPaste #</div><div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close'>#= messages.okText #</button></div>"}}),e.spreadsheet.dialogs.register("useKeyboard",F),R=l.extend({options:{template:"<div class='k-edit-label'><label>#: messages.linkDialog.labels.url #:</label></div><div class='k-edit-field'><input class='k-textbox' data-bind='value: url' /></div><div class='k-action-buttons'><button style='float: left' class='k-button' data-bind='click: remove'>#= messages.linkDialog.labels.removeLink #</button><button class='k-button k-primary' data-bind='click: apply'>#= messages.okText #</button><button class='k-button' data-bind='click: cancel'>#= messages.cancel #</button></div>",title:s.linkDialog.title,autoFocus:!1},open:function(t){var n,i,o=this;l.fn.open.apply(o,arguments),
n=o.dialog().element,i=e.observable({url:t.link(),apply:function(){/\S/.test(i.url)||(i.url=null),o.trigger("action",{command:"HyperlinkCommand",options:{link:i.url}}),o.close()},remove:function(){i.url=null,i.apply()},cancel:o.close.bind(o)}),e.bind(n,i),n.find("input").focus().on("keydown",function(e){13==e.keyCode?(i.url=r(this).val(),e.stopPropagation(),e.preventDefault(),i.apply()):27==e.keyCode&&(e.stopPropagation(),e.preventDefault(),i.cancel())})}}),e.spreadsheet.dialogs.register("hyperlink",R))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheetbinder.min",["kendo.core.min","kendo.data.min","spreadsheet/sheet.min"],e)}(function(){!function(e){var t,n;e.support.browser.msie&&e.support.browser.version<9||(t=function(e){return e},n=e.Class.extend({init:function(e){this.options=$.extend({},this.options,e),this.columns=this._normalizeColumns(this.options.columns),this._sheet(),this._dataSource(),this._header(),this._boundRowsCount=0,this.dataSource.fetch()},_sheet:function(){this.sheet=this.options.sheet,this._sheetChangeHandler=this._sheetChange.bind(this),this._sheetDeleteRowHandler=this._sheetDeleteRow.bind(this),this._sheetInsertRowHandler=this._sheetInsertRow.bind(this),this.sheet.bind("change",this._sheetChangeHandler).bind("deleteRow",this._sheetDeleteRowHandler).bind("insertRow",this._sheetInsertRowHandler)},_sheetInsertRow:function(e){void 0!==e.index&&this.dataSource.insert(Math.max(e.index-1,0),{})},_sheetDeleteRow:function(e){var t,n;void 0!==e.index&&(t=this.dataSource,n=t.view()[e.index-1],n&&t.remove(n))},_header:function(){this.sheet.batch(function(){this.columns.forEach(function(e,t){this.sheet.range(0,t).value(e.title)}.bind(this))}.bind(this))},_sheetChange:function(n){var i,r,o,s,a,l;n.insertRow||n.deleteRow||n.recalc&&n.ref&&(i=this.dataSource,r=i.view(),o=this.columns,i.reader.model&&(s=i.reader.model.fields),!o.length&&r.length&&(o=Object.keys(r[0].toJSON())),a=o.map(function(n){var i=n.field;return i&&s&&s[i]&&"date"==s[i].type?e.spreadsheet.numberToDate:t}),this._skipRebind=!0,l=this.sheet.range(n.ref).values(),n.ref.forEach(function(e){var t,n,s,u,c;for(e=e.toRangeRef(),n=0,s=e.topLeft.row;s<=e.bottomRight.row;s++){for(t=r[s-1],t||(t=i.insert(s-1,{}),r=i.view()),u=0,c=e.topLeft.col;c<=e.bottomRight.col&&c<o.length;c++)t.set(o[c].field,a[c](l[n][u++]));n++}}),this._boundRowsCount=i.view().length,this._skipRebind=!1)},_normalizeColumns:function(e){return e.map(function(e){var t=e.field||e;return{field:t,title:e.title||t}})},_dataSource:function(){var t=this.options,n=t.dataSource;n=Array.isArray(n)?{data:n}:n,this.dataSource&&this._changeHandler?this.dataSource.unbind("change",this._changeHandler):this._changeHandler=this._change.bind(this),this.dataSource=e.data.DataSource.create(n).bind("change",this._changeHandler)},_change:function(){var t,n,i;this._skipRebind||(t=this.dataSource.view(),n=this.columns,!n.length&&t.length&&(this.columns=n=this._normalizeColumns(Object.keys(t[0].toJSON())),this._header()),i=n.map(function(t){return e.getter(t.field)}),this.sheet.batch(function(){var e,n,r,o=Math.max(t.length,this._boundRowsCount);for(e=0;e<o;e++)for(n=0;n<i.length;n++)r=t[e]?i[n](t[e]):null,this.sheet.range(e+1,n).value(r)}.bind(this)),this._boundRowsCount=t.length)},destroy:function(){this.dataSource.unbind("change",this._changeHandler),this.sheet.unbind("change",this._sheetChangeHandler).unbind("deleteRow",this._sheetDeleteRowHandler).unbind("insertRow",this._sheetInsertRowHandler)},options:{columns:[]}}),e.spreadsheet.SheetDataSourceBinder=n)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/filtermenu.min",["kendo.core.min","kendo.popup.min","kendo.treeview.min","kendo.numerictextbox.min","kendo.datepicker.min","kendo.datetimepicker.min"],e)}(function(){!function(e){function t(e){var t,n={},i=[];for(t=0;t<e.length;t++)n[e[t].value]?!n[e[t].value].checked&&e[t].checked&&(n[e[t].value].checked=!0):(n[e[t].value]=e[t],i.push(e[t]));return i}function n(t,i){var r,o,s,a,l,u=!1,c=t instanceof e.data.HierarchicalDataSource&&t.data();for(r=0;r<c.length;r++)o=c[r],s=(""+o.text).toLowerCase(),a=i===!0||""===i||s.indexOf(i)>=0,l=n(o.children,a||i),u=u||l||a,o.hidden=!a&&!l,o.checked=!o.hidden;return c&&t.filter({field:"hidden",operator:"neq",value:!0}),u}function i(t){var n,r,o=t instanceof e.data.HierarchicalDataSource&&t.data();for(n=0;n<o.length;n++)r=o[n],r.checked=!1,r.hasChildren&&i(r.children)}function r(e){var t,n,i=u.operators,r=[];for(t in e)if(e.hasOwnProperty(t))for(n in e[t])e[t].hasOwnProperty(n)&&r.push({text:i[t][n],value:n,unique:t+"_"+n,type:t});return r}var o,s,a,l,u,c,h,d,f;e.support.browser.msie&&e.support.browser.version<9||(o=e.jQuery,s=e.ui.Widget,a={details:"k-details",button:"k-button",detailsSummary:"k-details-summary",detailsContent:"k-details-content",icon:"k-icon k-font-icon",iconCollapse:"k-i-collapse-se",iconExpand:"k-i-expand-e",iconSearch:"k-i-search",textbox:"k-textbox",wrapper:"k-spreadsheet-filter-menu",filterByCondition:"k-spreadsheet-condition-filter",filterByValue:"k-spreadsheet-value-filter",valuesTreeViewWrapper:"k-spreadsheet-value-treeview-wrapper",actionButtons:"k-action-buttons"},l=s.extend({init:function(t,n){s.fn.init.call(this,t,n),this.element.addClass(f.classNames.details),this._summary=this.element.find("."+f.classNames.detailsSummary).on("click",this._toggle.bind(this));var i=n.expanded?f.classNames.iconCollapse:f.classNames.iconExpand;this._icon=o("<span />",{"class":f.classNames.icon+" "+i}).prependTo(this._summary),this._container=e.wrap(this._summary.next(),!0),n.expanded||this._container.hide()},options:{name:"Details"},events:["toggle"],visible:function(){return this.options.expanded},toggle:function(t){var n=e.fx(this._container).expand("vertical");n.stop()[t?"reverse":"play"](),this._icon.toggleClass(f.classNames.iconExpand,t).toggleClass(f.classNames.iconCollapse,!t),this.options.expanded=!t},_toggle:function(){var e=this.visible();this.toggle(e),this.trigger("toggle",{show:e})}}),u=e.spreadsheet.messages.filterMenu={sortAscending:"Sort range A to Z",sortDescending:"Sort range Z to A",filterByValue:"Filter by value",filterByCondition:"Filter by condition",apply:"Apply",search:"Search",addToCurrent:"Add to current selection",clear:"Clear",blanks:"(Blanks)",operatorNone:"None",and:"AND",or:"OR",operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},e.data.binders.spreadsheetFilterValue=e.data.Binder.extend({init:function(t,n,i){e.data.Binder.fn.init.call(this,t,n,i),this._change=o.proxy(this.change,this),o(this.element).on("change",this._change)},refresh:function(){var e=this,t=e.bindings.spreadsheetFilterValue.get();o(e.element).val(t instanceof Date?"":t)},change:function(){var e=this.element.value;this.bindings.spreadsheetFilterValue.set(e)}}),e.data.binders.widget.spreadsheetFilterValue=e.data.Binder.extend({init:function(t,n,i){e.data.Binder.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=o.proxy(this.change,this),this.widget.first("change",this._change)},refresh:function(){var e=this.bindings.spreadsheetFilterValue,t=e.get(),n=o(this.widget.element).data("filterType");this.widget.value("date"===n&&t instanceof Date||"number"===n&&!isNaN(t)?t:null)},change:function(){var e=this.widget.value(),t=this.bindings.spreadsheetFilterValue;t.set(e)}}),c={filterByValue:"<div class='"+a.detailsSummary+"'>#= messages.filterByValue #</div><div class='"+a.detailsContent+"'><div class='k-textbox k-space-right'><input placeholder='#= messages.search #' data-#=ns#bind='events: { input: filterValues }' /><span class='k-icon k-font-icon k-i-search' /></div><div data-#=ns#bind='visible: hasActiveSearch'><input class='k-checkbox' type='checkbox' data-#=ns#bind='checked: appendToSearch' id='_#=guid#' /><label class='k-checkbox-label' for='_#=guid#'>#= messages.addToCurrent #</label></div><div class='"+a.valuesTreeViewWrapper+"'><div data-#=ns#role='treeview' data-#=ns#checkboxes='{ checkChildren: true }' data-#=ns#bind='source: valuesDataSource, events: { check: valuesChange, select: valueSelect }' /></div></div>",filterByCondition:"<div class='"+a.detailsSummary+"'>#= messages.filterByCondition #</div><div class='"+a.detailsContent+'\'><div><select data-#=ns#role="dropdownlist"data-#=ns#bind="value: operator, source: operators, events: { change: operatorChange } "data-value-primitive="false"data-option-label="#=messages.operatorNone#"data-height="auto"data-text-field="text"data-value-field="unique"></select></div><div data-#=ns#bind="visible: isString"><input data-filter-type="string" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" class="k-textbox" /></div><div data-#=ns#bind="visible: isNumber"><input data-filter-type="number" data-#=ns#role="numerictextbox" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" /></div><div data-#=ns#bind="visible: isDate"><input data-filter-type="date" data-#=ns#role="datepicker" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" /></div></div>',menuItem:"<li data-command='#=command#' data-dir='#=dir#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</li>",actionButtons:"<button data-#=ns#bind='click: apply' class='k-button k-primary'>#=messages.apply#</button><button data-#=ns#bind='click: clear' class='k-button'>#=messages.clear#</button>"},h=e.spreadsheet.FilterMenuViewModel=e.data.ObservableObject.extend({valuesChange:function(t){var n=t?t.sender.dataSource:this.valuesDataSource,i=function(e){return e.checked},r=function(t){return"date"===t.dataType?e.spreadsheet.dateToNumber(t.value):t.value},o=function(e,t,n){return n.lastIndexOf(e)===t},s=n.data(),a=s[0].children.data().toJSON(),l=a.filter(function(e){return"blank"===e.dataType});l=!!l.length&&l[0].checked,a=a.filter(i).map(r),this.appendToSearch&&this.valueFilter&&this.valueFilter.values.length&&(a=a.concat(this.valueFilter.values.toJSON()).sort().filter(o)),this.set("valueFilter",{values:a,blanks:l})},valueSelect:function(e){e.preventDefault();var t=e.sender.dataItem(e.node);t.set("checked",!t.checked)},hasActiveSearch:!1,appendToSearch:!1,filterValues:function(e){var t="string"==typeof e?e:o(e.target).val().toLowerCase(),r=this.valuesDataSource;this.set("hasActiveSearch",!!t),i(r),n(r,t)},reset:function(){this.set("customFilter",{logic:"and",criteria:[{operator:null,value:null}]}),this.set("valueFilter",{values:[]})},operatorChange:function(e){var t=e.sender.dataItem();this.set("operatorType",t.type),this.set("customFilter.criteria[0].operator",t.value)},isNone:function(){return void 0===this.get("operatorType")},isString:function(){return"string"===this.get("operatorType")},isNumber:function(){return"number"===this.get("operatorType")},isDate:function(){return"date"===this.get("operatorType")}}),d=e.spreadsheet.FilterMenuController={valuesTree:function(e,t){return[{text:"All",expanded:!0,checked:!0,items:this.values(e.resize({top:1}),t)}]},values:function(n,i){var r=[],o=u,s=n.column(i),a=n.sheet();return s.forEachCell(function(t,n,i){var s,l,u;a.isHiddenRow(t)||(s=i.value,l=i.dataType,u=i.text,l=void 0===s?"blank":i.format?e.spreadsheet.formatting.type(s,i.format):typeof s,u=null!==s&&i.format?e.spreadsheet.formatting.text(s,i.format):"blank"==l?o.blanks:s,"percent"===l&&(l="number"),"date"===l&&(s=e.spreadsheet.numberToDate(s)),r.push({dataType:l,value:s,text:u,checked:!0}))}),r=t(r),r.sort(function(e,t){return e.dataType===t.dataType?0:"blank"===e.dataType||"blank"===t.dataType?"blank"===e.dataType?-1:1:"number"===e.dataType||"number"===t.dataType?"number"===e.dataType?-1:1:"date"===e.dataType||"date"===t.dataType?"date"===e.dataType?-1:1:0}),r},filterType:function(e,t){var n,i,r,o=e.sheet(),s=this.filterForColumn(t,o);return s=s&&s.filter.toJSON(),s&&"custom"==s.filter&&(i=s.criteria[0].value,i instanceof Date?n="date":"string"==typeof i?n="string":"number"==typeof i&&(n="number")),n||(r=this.values(e.row(1),t)[0],n=r&&r.dataType,"blank"==n&&(n=null)),n},filterForColumn:function(e,t){var n,i=t.filter();return i&&(n=i.columns.filter(function(t){return t.index===e})[0]),n},filter:function(e,t){var n,i,r,o,s=this.filterForColumn(e,t);if(s)return n=s.filter.toJSON(),i=n.filter,delete n.filter,r={type:i,options:n},o=n.criteria,o&&o.length&&(r.operator=o[0].operator),r}},f=s.extend({init:function(e,t){s.call(this,e,t),this.element.addClass(f.classNames.wrapper),this.viewModel=new h({active:"value",operator:null,operators:r(this.options.operators),clear:this.clear.bind(this),apply:this.apply.bind(this)}),this._filterInit(),this._popup(),this._sort(),this._filterByCondition(),this._filterByValue(),this._actionButtons()},options:{name:"FilterMenu",column:0,range:null,operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},events:["action"],destroy:function(){s.fn.destroy.call(this),this.menu.destroy(),this.valuesTreeView.destroy(),this.popup.destroy()},openFor:function(e){this.popup.setOptions({anchor:e}),this.popup.open()},close:function(){this.popup.close()},clear:function(){this.action({command:"ClearFilterCommand",options:{column:this.options.column}}),this.viewModel.reset(),this.close()},apply:function(){var e,t,n;this._active(),e={operatingRange:this.options.range,column:this.options.column},"value"===this.viewModel.active?(this.viewModel.valuesChange({sender:this.valuesTreeView}),t=this.viewModel.valueFilter.toJSON(),(t.blanks||t.values&&t.values.length)&&(e.valueFilter=t)):"custom"===this.viewModel.active&&(n=this.viewModel.customFilter.toJSON(),n.criteria.length&&null!==n.criteria[0].value&&(e.customFilter=n)),(e.valueFilter||e.customFilter)&&this.action({command:"ApplyFilterCommand",options:e})},action:function(e){this.trigger("action",o.extend({},e))},_filterInit:function(){var e,t=this.options.column,n=this.options.range,i=n.sheet(),r=d.filter(t,i);r?(e=d.filterType(n,t),this.viewModel.set("active",r.type),this.viewModel.set(r.type+"Filter",r.options),"custom"==r.type&&(this.viewModel.set("operator",e+"_"+r.operator),this.viewModel.set("operatorType",e))):this.viewModel.reset()},_popup:function(){this.popup=this.element.kendoPopup({copyAnchorStyles:!1}).data("kendoPopup")},_sort:function(){var t=e.template(f.templates.menuItem),n=u,i=[{command:"sort",dir:"asc",text:n.sortAscending,iconClass:"sort-asc"},{command:"sort",dir:"desc",text:n.sortDescending,iconClass:"sort-desc"}],r=o("<ul />",{html:e.render(t,i)}).appendTo(this.element);this.menu=r.kendoMenu({orientation:"vertical",select:function(e){var t=o(e.item).data("dir"),n=this.options.range.resize({top:1}),i={value:t,sheet:!1,operatingRange:n,column:this.options.column};n.isSortable()?this.action({command:"SortCommand",options:i}):this.close()}.bind(this)}).data("kendoMenu")},_appendTemplate:function(t,n,i,r){var s=e.template(t),a=o("<div class='"+n+"'/>").html(s({messages:u,guid:e.guid(),ns:e.ns}));return this.element.append(a),i&&(i=new l(a,{expanded:r,toggle:this._detailToggle.bind(this)})),e.bind(a,this.viewModel),a},_detailToggle:function(e){this.element.find("[data-role=details]").not(e.sender.element).data("kendoDetails").toggle(!e.show)},_filterByCondition:function(){var e="custom"===this.viewModel.active;this._appendTemplate(f.templates.filterByCondition,f.classNames.filterByCondition,!0,e)},_filterByValue:function(){var t,n="value"===this.viewModel.active,i=this._appendTemplate(f.templates.filterByValue,f.classNames.filterByValue,!0,n);this.valuesTreeView=i.find("[data-role=treeview]").data("kendoTreeView"),t=d.valuesTree(this.options.range,this.options.column),this.viewModel.set("valuesDataSource",new e.data.HierarchicalDataSource({data:t}))},_actionButtons:function(){this._appendTemplate(f.templates.actionButtons,f.classNames.actionButtons,!1)},_active:function(){var e=this.element.find("[data-role=details]").filter(function(e,t){return o(t).data("kendoDetails").visible()});e.hasClass(f.classNames.filterByValue)?this.viewModel.set("active","value"):e.hasClass(f.classNames.filterByCondition)&&this.viewModel.set("active","custom")}}),e.spreadsheet.FilterMenu=f,o.extend(!0,f,{classNames:a,templates:c}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/editor.min",["kendo.core.min"],e)}(function(){!function(e){function t(e,t){return e&&(e.top!==t.top||e.left!==t.left)}if(!(e.support.browser.msie&&e.support.browser.version<9)){var n=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this),this.view=t,this.formulaBar=t.formulaBar,this._active=!1,this.barInput=t.formulaBar.formulaInput,this.cellInput=t.formulaInput,this.barInput.syncWith(this.cellInput),this.cellInput.syncWith(this.barInput),this.barInput.bind("keyup",this._triggerUpdate.bind(this)),this.cellInput.bind("keyup",this._triggerUpdate.bind(this)),this.barInput.bind("focus",this._focus.bind(this)),this.cellInput.bind("focus",this._focus.bind(this)),this.barInput.bind("blur",this._blur.bind(this)),this.cellInput.bind("blur",this._blur.bind(this))},events:["activate","deactivate","change","update"],_focus:function(e){this.lastActive=e.sender==this.barInput?"bar":"cell"},_blur:function(){},_triggerUpdate:function(){this.trigger("update",{value:this.value()})},activeEditor:function(){var t=null,n=e._activeElement();return this.barElement()[0]===n?t=this.barInput:this.cellElement()[0]===n&&(t=this.cellInput),t},activate:function(e){return this._active=!0,this._rect=e.rect,this.cellInput.position(e.rect),this.cellInput.resize(e.rect),this.cellInput.tooltip(e.tooltip),this.cellInput.activeCell=this.barInput.activeCell=e.range.topLeft,this.trigger("activate"),this},deactivate:function(){var e=this.cellInput;this._active&&(e.value()!=this._value&&this.trigger("change",{value:e.value()})||(this._active=!1,this._rect=null,e.hide(),this.trigger("deactivate")))},enable:function(e){this.barInput.enable(e),this.cellInput.enable(e)},enableEditing:function(e){this.barInput.enableEditing(e),this.cellInput.enableEditing(e)},barElement:function(){return this.barInput.element},cellElement:function(){return this.cellInput.element},focusLastActive:function(){this.focus(this.lastActive)},focus:function(e){e=e||"cell","cell"===e?(this.cellInput.element.focus(),this.cellInput.end()):this.barInput.element.focus()},isActive:function(){return this._active},isFiltered:function(){return this.barInput.popup.visible()||this.cellInput.popup.visible()},canInsertRef:function(e){var t=this.activeEditor();return t&&t.canInsertRef(e)},highlightedRefs:function(){var e=this.activeEditor(),t=[];return e&&(t=e.highlightedRefs()),t},scale:function(){this.cellInput.scale()},toggleTooltip:function(e){this.cellInput.toggleTooltip(t(this._rect,e))},value:function(e){return void 0===e?this.barInput.value():(null===e&&(e=""),this._value=e,this.barInput.value(e),void this.cellInput.value(e))},insertNewline:function(){this.activeEditor().insertNewline(),this.scale()}});e.spreadsheet.SheetEditor=n}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/autofill.min",["spreadsheet/runtime.min","spreadsheet/range.min"],e)}(function(){"use strict";function e(e){var t,n,i,r,o,s=e.length,a=(s+1)/2,l=e.reduce(function(e,t){return e+t},0)/s,u=0,c=0;for(t=0;t<s;t++)n=t+1-a,i=e[t]-l,u+=n*i,c+=n*n;return c?(r=u/c,o=l-r*a,function(e){return o+r*(e+1)}):function(t){return e[t%e.length]}}function t(t){function o(e){var t,n=e[1]-e[0];for(t=2;t<e.length;++t)if(e[t]-e[t-1]!=n)return null;return n}function s(e){return e.map(function(e){return e.number})}var a=[],l=t.map(function(e){return e.formula||e.value});return r(l,function(i,r,u,c){var h,d,f,p,m;for("number"==u?(d=s(c),1==d.length&&(i>0||r<l.length||"date"==n(d[0],t[i].format))&&d.push(d[0]+1),h=e(d)):"string"==u||"formula"==u||"boolean"==u?h=function(e,t){return l[t]}:Array.isArray(u)?1==c.length?h=function(e){return u[(c[0].number+e)%u.length]}:(f=o(s(c)),h=null==f?function(e){return c[e%c.length].value}:function(e){var t=c[0].number+f*e;return u[t%u.length]}):"null"!=u?(d=s(c),1==d.length&&d.push(d[0]+1),d=e(d),h=function(e,t){return l[t].replace(/^(.*\D)\d+/,"$1"+d(e,t))}):h=function(){return null},p={f:h,begin:i,end:r,len:r-i},m=i;m<r;++m)a[m]=p}),function(e,n){var r=a[n],o=e/l.length|0,s=e%l.length,u=o*r.len+s-r.begin,c=r.f(u,n),h=i(t[n]);return delete h.enable,c instanceof d?h.formula=c:h.value=c,h}}function n(e,t){if(null!=t)return u.formatting.type(e,t)}function i(e){var t={};return Object.keys(e||{}).forEach(function(n){t[n]=e[n]}),t}function r(e,t){var n,i,r=null,s=0,a=[];for(i=0;i<e.length;++i)n=o(e[i]),a.push(n),null!=r&&n.type!==r.type&&(t(s,i,r.type,a.slice(s,i)),s=i),r=n;t(s,i,r.type,a.slice(s,i))}function o(e){var t,n;if("number"==typeof e)return{type:"number",number:e};if("string"==typeof e)return(t=a(e))?t:(n=/^(.*\D)(\d+)/.exec(e),n?(e=e.replace(/^(.*\D)\d+/,"$1-######"),{type:e,match:n,number:parseFloat(n[2])}):{type:"string"});if("boolean"==typeof e)return{type:"boolean"};if(null==e)return{type:"null"};if(e instanceof d)return{type:"formula"};throw window.console.error(e),Error("Cannot fill data")}function s(){var e=kendo.culture();return[e.calendars.standard.days.namesAbbr,e.calendars.standard.days.names,e.calendars.standard.months.namesAbbr,e.calendars.standard.months.names]}function a(e){var t,n,i,r,o=e.toLowerCase(),a=s();for(t=0;t<a.length;++t)for(n=a[t],i=n.length;--i>=0;)if(r=n[i].toLowerCase(),r==o)return{type:n,number:i,value:e}}function l(e){var t,n,i=e.length,r=e[0].length,o=[];for(t=0;t<r;++t)for(o[t]=[],n=0;n<i;++n)o[t][n]=e[n][t];return o}var u,c,h,d,f,p,m;kendo.support.browser.msie&&kendo.support.browser.version<9||(u=kendo.spreadsheet,c=u.Range,h=u.calc.runtime,d=h.Formula,f="incompatibleRanges",p="noFillDirection",m=c.FillError=function(e){this.code=e},c.prototype._previewFillFrom=function(e,n){var i,r,o,s,a,u,c,h,d,g,v,b,w,y,_=this,k=_._sheet;if("string"==typeof e&&(e=k.range(e)),i=e._ref.toRangeRef(),r=_._ref.toRangeRef(),i.intersects(r)){if(i.eq(r))return null;if(r=r.clone(),i.topLeft.eq(r.topLeft))if(i.width()==r.width())r.topLeft.row+=i.height(),n=0;else{if(i.height()!=r.height())throw new m(f);r.topLeft.col+=i.width(),n=1}else{if(!i.bottomRight.eq(r.bottomRight))throw new m(f);if(i.width()==r.width())r.bottomRight.row-=i.height(),n=2;else{if(i.height()!=r.height())throw new m(f);r.bottomRight.col-=i.width(),n=3}}return k.range(r)._previewFillFrom(e,n)}if(null==n)if(i.topLeft.col==r.topLeft.col)n=i.topLeft.row<r.topLeft.row?0:2;else{if(i.topLeft.row!=r.topLeft.row)throw new m(p);n=i.topLeft.col<r.topLeft.col?1:3}if(o=1&n,s=2&n,o&&i.height()!=r.height()||!o&&i.width()!=r.width())throw new m(f);for(a=e._properties(),o?u=r.width():(a=l(a),u=r.height()),c=Array(a.length),h=0;h<a.length;++h)for(d=a[h],g=t(d),v=c[h]=Array(u),b=0;b<u;++b)w=s?-b-1:d.length+b,y=s?d.length-b%d.length-1:b%d.length,v[s?u-b-1:b]=g(w,y);return o||(c=l(c)),{props:c,direction:n,dest:_}},c.prototype.fillFrom=function(e,t){var n=this._previewFillFrom(e,t);return n.dest._properties(n.props),n.dest})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/nameeditor.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n={input:"k-spreadsheet-name-editor",list:"k-spreadsheet-name-list"},i=e.ui.Widget.extend({init:function(i,r){e.ui.Widget.call(this,i,r),i.addClass(n.input);var o=new e.data.DataSource({transport:{read:function(t){var n=[];this._workbook.forEachName(function(t){!t.hidden&&t.value instanceof e.spreadsheet.Ref&&n.push({name:t.name})}),t.success(n)}.bind(this),cache:!1}});this.combo=t("<input />").appendTo(i).kendoComboBox({clearButton:!1,dataTextField:"name",dataValueField:"name",template:"#:data.name#<a class='k-button-delete' href='\\#'><span class='k-icon k-i-close'></span></a>",dataSource:o,autoBind:!1,ignoreCase:!0,change:this._on_listChange.bind(this),noDataTemplate:"<div></div>",open:function(){o.read()}}).getKendoComboBox(),this.combo.input.on("keydown",this._on_keyDown.bind(this)).on("focus",this._on_focus.bind(this)),this.combo.popup.element.addClass("k-spreadsheet-names-popup").on("mousemove",function(e){e.stopPropagation()}).on("click",".k-button-delete",function(e){e.preventDefault(),e.stopPropagation();var n=t(e.target).closest(".k-item");n=this.combo.dataItem(n),this._deleteItem(n.name)}.bind(this))},value:function(e){return void 0===e?this.combo.value():void this.combo.value(e)},_deleteItem:function(e){this.trigger("delete",{name:e})},_on_keyDown:function(e){switch(e.keyCode){case 27:this.combo.value(this._prevValue),this.trigger("cancel");break;case 13:this.trigger("enter")}},_on_focus:function(){this._prevValue=this.combo.value()},_on_listChange:function(){var e=this.combo.value();e&&this.trigger("select",{name:e})}}),e.spreadsheet.NameEditor=i)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/print.min",["kendo.pdf.min","spreadsheet/sheet.min","spreadsheet/range.min","spreadsheet/references.min","spreadsheet/numformat.min","util/text-metrics.min"],e)}(function(){"use strict";function e(e,t){var n=0,i=[],r=.2*t,o=t;return e.forEach(function(e){t&&n+e>o&&(o-n<r&&(n=t*Math.ceil(n/t)),o+=t*Math.ceil(e/t)),i.push(n),n+=e}),i.push(n),i}function t(e,t){var n=e._grid,i={},r={};return e.forEachMergedCell(t,function(e){var o=e.topLeft;n.forEach(e,function(n){o.eq(n)?i[n.print()]=e:t.contains(n)&&(r[n.print()]=o)})}),{primary:i,secondary:r}}function n(n,a,l){var u,c,h,d,f,p,g,v,b=[],w=[],y=[],_=t(n,a),k=-1,x=-1;return n.forEach(a,function(e,t,i){var r,s,u,c=e-a.topLeft.row,h=t-a.topLeft.col,d=n.rowHeight(e),f=n.columnWidth(t);h||w.push(d),c||y.push(f),!n.isHiddenColumn(t)&&!n.isHiddenRow(e)&&d&&f&&(r=l.forScreen||o(i),(l.emptyCells||r)&&(s=new m(e,t).print(),_.secondary[s]||(r?(k=Math.max(k,c),x=Math.max(x,h)):i.empty=!0,u=_.primary[s],u?(delete _.primary[s],i.merged=!0,i.rowspan=u.height(),i.colspan=u.width(),l.forScreen&&(i.width=n._columns.sum(u.topLeft.col,u.bottomRight.col),i.height=n._rows.sum(u.topLeft.row,u.bottomRight.row))):(i.rowspan=1,i.colspan=1),i.row=c,i.col=h,b.push(i))))}),w=w.slice(0,k+1),y=y.slice(0,x+1),u=l.pageWidth,c=l.pageHeight,h=1,l.fitWidth&&(d=y.reduce(i,0),d>u&&(h=u/d,u/=h,c/=h)),f=e(w,c||0),p=e(y,u||0),g=0,v=0,b=b.filter(function(e){return(!e.empty||!(e.row>k||e.col>x))&&(e.left=p[e.col],e.top=f[e.row],e.merged?l.forScreen?(e.right=e.left+e.width,e.bottom=e.top+e.height):(e.right=r(p,e.col+e.colspan),e.bottom=r(f,e.row+e.rowspan),e.width=e.right-e.left,e.height=e.bottom-e.top):(e.width=y[e.col],e.height=w[e.row],e.bottom=e.top+e.height,e.right=e.left+e.width),g=Math.max(g,e.right),v=Math.max(v,e.bottom),!0)}),Object.keys(_.primary).forEach(function(e){var t=_.primary[e];n.forEach(t.topLeft.toRangeRef(),function(e,i,r){var o=e-a.topLeft.row,s=i-a.topLeft.col;r.merged=!0,r.colspan=t.height(),r.rowspan=t.width(),r.top=o<0?-n._rows.sum(e,e-o-1):f[o],r.left=s<0?-n._columns.sum(i,i-s-1):p[s],r.height=n._rows.sum(t.topLeft.row,t.bottomRight.row),r.width=n._columns.sum(t.topLeft.col,t.bottomRight.col),r.height>0&&r.width>0&&(r.right=r.left+r.width,r.bottom=r.top+r.height,b.push(r))})}),{width:g,height:v,cells:b.sort(s),scale:h,xCoords:p,yCoords:f}}function i(e,t){return e+t}function r(e,t){return t<e.length?e[t]:e[e.length-1]}function o(e){return null!=e.value||e.merged||null!=e.background||null!=e.borderTop||null!=e.borderRight||null!=e.borderBottom||null!=e.borderLeft||null!=e.validation&&!e.validation.value}function s(e,t){return e.top<t.top?-1:e.top==t.top?e.left<t.left?-1:e.left==t.left?0:1:1}function a(e,t,n){function i(i,r){var o,s,a,h,d,f=r*u,p=f+u,m=i*c,v=m+c,y=0,_=0,k=e.cells.filter(function(e){return!(e.right<=f||e.left>=p||e.bottom<=m||e.top>=v)&&(y=Math.max(e.bottom,y),_=Math.max(e.right,_),!0)});k.length>0&&(o=new g.Group,t.append(o),o.clip(g.Path.fromRect(new b.Rect([0,0],[n.pageWidth,n.pageHeight]))),s=new g.Group,o.append(s),a=b.Matrix.scale(e.scale,e.scale).multiplyCopy(b.Matrix.translate(-f,-m)),(n.hCenter||n.vCenter)&&(a=a.multiplyCopy(b.Matrix.translate(n.hCenter?(p-_)/2:0,n.vCenter?(v-y)/2:0))),s.transform(a),n.guidelines&&(h=null,e.xCoords.forEach(function(e){e=Math.min(e,_),e!==h&&e>=f&&e<=p&&(h=e,s.append((new g.Path).moveTo(e,m).lineTo(e,y).close().stroke("#999",w)))}),h=null,e.yCoords.forEach(function(e){e=Math.min(e,y),e!==h&&e>=m&&e<=v&&(h=e,s.append((new g.Path).moveTo(f,e).lineTo(_,e).close().stroke("#999",w)))})),d=new g.Group,k.forEach(function(e){l(e,s,d,n)}),s.append(d))}var r,o,s=Math.ceil(e.width/n.pageWidth),a=Math.ceil(e.height/n.pageHeight),u=n.pageWidth/e.scale,c=n.pageHeight/e.scale;for(r=0;r<s;++r)for(o=0;o<a;++o)i(o,r)}function l(e,t,n,i){var r,o,s,a,l,c,h=new g.Group;if(t.append(h),r=new b.Rect([e.left,e.top],[e.width,e.height]),(e.background||e.merged)&&(o=r,i.guidelines&&(o=r.clone(),o.origin.x+=w/2,o.origin.y+=w/2,o.size.width-=w,o.size.height-=w),h.append(new g.Rect(o).fill(e.background||"#fff").stroke(null))),e.borderLeft&&n.append((new g.Path).moveTo(e.left,e.top).lineTo(e.left,e.bottom).close().stroke(e.borderLeft.color,e.borderLeft.size)),e.borderTop&&n.append((new g.Path).moveTo(e.left,e.top).lineTo(e.right,e.top).close().stroke(e.borderTop.color,e.borderTop.size)),e.borderRight&&n.append((new g.Path).moveTo(e.right,e.top).lineTo(e.right,e.bottom).close().stroke(e.borderRight.color,e.borderRight.size)),e.borderBottom&&n.append((new g.Path).moveTo(e.left,e.bottom).lineTo(e.right,e.bottom).close().stroke(e.borderBottom.color,e.borderBottom.size)),s=e.value,null!=s){if(a="number"==typeof s?"number":null,l=new g.Group,l.clip(g.Path.fromRect(r)),h.append(l),e.format?(c=v.textAndColor(s,e.format),s=c.text,c.type&&(a=c.type)):s+="",!e.textAlign)switch(a){case"number":case"date":case"percent":e.textAlign="right";break;case"boolean":e.textAlign="center"}u(s,c&&c.color||e.color||"#000",e,l)}}function u(e,t,n,i){var r,o,s,a,l=n.left+2,u=n.top+2,c=n.width-4,f=n.height-4,p=d(n),m={font:p,whiteSpace:"pre"},v={font:p,fill:{color:t}},w=[],y=0,_=u;switch(n.wrap?(h(e,m,c).forEach(function(e){var t=new g.Text(e.text,[l,_],v);_+=e.box.height,w.push({el:t,box:e.box})}),y=_-u):(r=new g.Text(e,[l,_],v),o=kendo.util.measureText(e,m),w.push({el:r,box:o}),y=o.height),s=new g.Group,i.append(s),a=0,n.verticalAlign){case"center":a=f-y>>1;break;case void 0:case null:case"bottom":a=f-y}a<0&&(a=0),w.forEach(function(e){var i,r,o,l,u,h,d;switch(s.append(e.el),i=0,r=e.box.width,n.textAlign){case"center":i=(c-r)/2;break;case"right":i=c-r}i<0&&(i=0),(i||a)&&e.el.transform(b.Matrix.translate(i,a)),n.underline&&(o=n.fontSize||12,l=o/12,u=new g.Path({stroke:{width:l,color:t}}),h=e.el.position(),d=h.y+o+a+2*l,u.moveTo(h.x+i,d).lineTo(h.x+i+r,d),s.append(u))})}function c(e,t,n,i){function r(o,a,l){var u=e.substring(s,a).trim(),c=kendo.util.measureText(u,t);c.width<=n?a<l-1?r(a,a+l>>1,l):(i.push({text:u,box:c}),s=a):o<a&&r(o,o+a>>1,a)}for(var o=e.length,s=0;s<o;)r(s,o,o)}function h(e,t,n){var i=e.split(/\r?\n/),r=[];return i.forEach(function(e){c(e,t,n,r)}),r}function d(e){var t=[];return e.italic&&t.push("italic"),e.bold&&t.push("bold"),t.push((e.fontSize||12)+"px"),t.push(e.fontFamily||"Arial"),t.join(" ")}function f(e,t,i,r){var o,s,l,u,c;null==i&&null==r&&(r=t,i={},t=p.SHEETREF),null==r&&(r=i,t instanceof p.Range||t instanceof p.Ref||"string"==typeof t?i={}:(i=t,
t=p.SHEETREF)),i=kendo.jQuery.extend({paperSize:"A4",landscape:!0,margin:"1cm",guidelines:!0,emptyCells:!0,fitWidth:!1,center:!1},i),o=new g.Group,s=kendo.pdf.getPaperOptions(i),o.options.set("pdf",{author:i.author,creator:i.creator,date:i.date,keywords:i.keywords,margin:s.margin,multiPage:!0,paperSize:s.paperSize,subject:i.subject,title:i.title}),l=s.paperSize[0],u=s.paperSize[1],s.margin&&(l-=s.margin.left+s.margin.right,u-=s.margin.top+s.margin.bottom),i.pageWidth=l,i.pageHeight=u,c=n(e,e._ref(t),i),a(c,o,i),r(o)}var p,m,g,v,b,w;kendo.support.browser.msie&&kendo.support.browser.version<9||(p=kendo.spreadsheet,m=p.CellRef,g=kendo.drawing,v=p.formatting,b=kendo.geometry,w=.8,p.Sheet.prototype.draw=function(e,t,n){var i=this;i._workbook?i.recalc(i._workbook._context,function(){f(i,e,t,n)}):f(i,e,t,n)},p.draw={doLayout:n,drawLayout:a,shouldDrawCell:o})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.spreadsheet.min",["util/undoredostack.min","util/text-metrics.min","util/parse-xml.min","kendo.excel.min","kendo.progressbar.min","kendo.pdf.min","spreadsheet/commands.min","spreadsheet/formulabar.min","spreadsheet/formulainput.min","spreadsheet/eventlistener.min","spreadsheet/rangelist.min","spreadsheet/propertybag.min","spreadsheet/references.min","spreadsheet/navigator.min","spreadsheet/axismanager.min","spreadsheet/clipboard.min","spreadsheet/range.min","spreadsheet/sheet.min","spreadsheet/sheetsbar.min","spreadsheet/excel-reader.min","spreadsheet/workbook.min","spreadsheet/formulacontext.min","spreadsheet/controller.min","spreadsheet/view.min","spreadsheet/customeditors.min","spreadsheet/grid.min","spreadsheet/axis.min","spreadsheet/filter.min","spreadsheet/sorter.min","spreadsheet/runtime.min","spreadsheet/calc.min","spreadsheet/numformat.min","spreadsheet/runtime.functions.min","spreadsheet/runtime.functions.2.min","spreadsheet/toolbar.min","spreadsheet/dialogs.min","spreadsheet/sheetbinder.min","spreadsheet/filtermenu.min","spreadsheet/editor.min","spreadsheet/autofill.min","spreadsheet/nameeditor.min","spreadsheet/print.min"],e)}(function(){return function(e,t){var n,i,r,o,s,a,l,u,c;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=e.ui.Widget,r=e.spreadsheet.Workbook,o=e.spreadsheet.Controller,s=e.spreadsheet.View,a=".kendoSpreadsheet",l={recalc:!0,selection:!0,activeCell:!0,layout:!0,sheetSelection:!0,resize:!0,editorChange:!1,editorClose:!1},u={wrapper:"k-widget k-spreadsheet"},c=e.ui.Widget.extend({init:function(e,t){i.fn.init.call(this,e,t),this.element.addClass(c.classNames.wrapper),this._view=new s(this.element,{messages:this.options.messages.view,toolbar:this.options.toolbar,sheetsbar:this.options.sheetsbar}),this._workbook=new r(this.options,this._view),this._controller=new o(this._view,this._workbook),this._autoRefresh=!0,this._bindWorkbookEvents(),this._view.workbook(this._workbook),this.refresh(),this._resizeHandler=function(){this.resize()}.bind(this),n(window).on("resize"+a,this._resizeHandler)},_resize:function(){this.refresh({layout:!0})},_workbookChange:function(t){if(this._autoRefresh&&this.refresh(t),t.recalc&&t.ref){var n=new e.spreadsheet.Range(t.ref,this.activeSheet());this.trigger("change",{range:n})}},activeSheet:function(e){return this._workbook.activeSheet(e)},moveSheetToIndex:function(e,t){return this._workbook.moveSheetToIndex(e,t)},insertSheet:function(e){return this._workbook.insertSheet(e)},sheets:function(){return this._workbook.sheets()},removeSheet:function(e){return this._workbook.removeSheet(e)},sheetByName:function(e){return this._workbook.sheetByName(e)},sheetIndex:function(e){return this._workbook.sheetIndex(e)},sheetByIndex:function(e){return this._workbook.sheetByIndex(e)},renameSheet:function(e,t){return this._workbook.renameSheet(e,t)},refresh:function(e){return e||(e=l),e.editorClose||(this._view.sheet(this._workbook.activeSheet()),this._controller.sheet(this._workbook.activeSheet()),this._workbook.refresh(e)),e.editorChange||(this._view.refresh(e),this._controller.refresh(),this._view.render(),this.trigger("render")),this},openDialog:function(e,t){return this._view.openDialog(e,t)},autoRefresh:function(e){return e!==t?(this._autoRefresh=e,e===!0&&this.refresh(),this):this._autoRefresh},toJSON:function(){return this._workbook.toJSON()},fromJSON:function(e){e.sheets?(this._workbook.destroy(),this._workbook=new r(n.extend({},this.options,e)),this._bindWorkbookEvents(),this._view.workbook(this._workbook),this._controller.workbook(this._workbook),this.activeSheet(this.activeSheet())):this.refresh()},fromFile:function(e,t){return this._workbook.fromFile(e,t)},saveAsPDF:function(e){this._workbook.saveAsPDF(n.extend({},this.options.pdf,e,{workbook:this._workbook}))},saveAsExcel:function(e){this._workbook.saveAsExcel(e)},draw:function(e,t){this._workbook.draw(e,t)},_workbookExcelExport:function(e){this.trigger("excelExport",e)&&e.preventDefault()},_workbookExcelImport:function(e){this.trigger("excelImport",e)?e.preventDefault():this._initProgress(e.promise)},_initProgress:function(t){var i=n("<div class='k-loading-mask' style='width: 100%; height: 100%; top: 0;'><div class='k-loading-color'/></div>").appendTo(this.element),r=n("<div class='k-loading-progress'>").appendTo(i).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar");t.progress(function(e){r.value(e.progress)}).always(function(){e.destroy(i),i.remove()})},_workbookPdfExport:function(e){this.trigger("pdfExport",e)&&e.preventDefault()},_bindWorkbookEvents:function(){this._workbook.bind("change",this._workbookChange.bind(this)),this._workbook.bind("excelExport",this._workbookExcelExport.bind(this)),this._workbook.bind("excelImport",this._workbookExcelImport.bind(this)),this._workbook.bind("pdfExport",this._workbookPdfExport.bind(this))},destroy:function(){e.ui.Widget.fn.destroy.call(this),this._workbook.destroy(),this._controller.destroy(),this._view.destroy(),this._resizeHandler&&n(window).off("resize"+a,this._resizeHandler)},options:{name:"Spreadsheet",toolbar:!0,sheetsbar:!0,rows:200,columns:50,rowHeight:20,columnWidth:64,headerHeight:20,headerWidth:32,excel:{proxyURL:"",fileName:"Workbook.xlsx"},messages:{},pdf:{area:"workbook",fileName:"Workbook.pdf",proxyURL:"",paperSize:"a4",landscape:!0,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator v."+e.version,date:null}},defineName:function(e,t,n){return this._workbook.defineName(e,t,n)},undefineName:function(e){return this._workbook.undefineName(e)},nameValue:function(e){return this._workbook.nameValue(e)},forEachName:function(e){return this._workbook.forEachName(e)},events:["pdfExport","excelExport","excelImport","change","render"]}),e.spreadsheet.ALL_REASONS=l,e.ui.plugin(c),n.extend(!0,c,{classNames:u}))}(window.kendo),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.spreadsheet.min.js.map
