@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 22.5 kB
JavaScript
module.exports=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}({0:function(t,e,r){r(1632),t.exports=r(1632)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},1618:function(t,e){t.exports=require("./references")},1632:function(t,e,r){var n,i,s;!function(a,define){i=[r(1618)],n=a,s="function"==typeof n?n.apply(e,i):n,!(void 0!==s&&(t.exports=s))}(function(){"use strict";function t(e){return e instanceof t?e:void(this.code=e)}function e(t,e,r){for(var n,i=r(t),s=t;++t<e;)n=r(t),n>i&&(i=n,s=t);return s}function r(t,e){if(t.constructor!==e.constructor)return!1;if(t instanceof E)return t.sheet==e.sheet&&t.row==e.row&&t.col==e.col&&t.rel==e.rel;if(t instanceof L)return r(t.topLeft,e.topLeft)&&r(t.bottomRight,e.bottomRight)&&t.endSheet==e.endSheet;if(t instanceof N){var n=t.refs.length;if(n!=e.refs.length)return!1;for(;--n>=0;)if(!r(t.refs[n],e.refs[n]))return!1}return!0}function n(e,r){function n(t){var e,r,i,a,h;return f=t[0],e="{ ",Array.isArray(f)?(l+="while (i < args.length) { ",g+="while (i < args.length) { ",e+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",e+="while (i < args.length) { ",e+=t.map(n).join(""),e+="} ",e+="xargs = stack.pop(); ",g+="} ",l+="} "):"+"==f?(l+="while (i < args.length) { ",g+="while (i < args.length) { ",e+="if (i >= args.length) return new CalcError('N/A'); ",e+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",e+="do { ",e+=t.slice(1).map(n).join(""),e+="} while (i < args.length); ",e+="xargs = stack.pop(); ",g+="} ",l+="} "):"?"==f?e+="if (!("+u(t[1])+")) return new CalcError(err); ":(r=t[1],Array.isArray(r)&&/^#?collect/.test(r[0])?(i=/!$/.test(r[0]),a=r[2],s(),e+="try {var $"+f+" = this.cellValues(args.slice(i",a&&(e+=", i + "+a),e+=")"+(i?",true":"")+").reduce(function(ret, $"+f+"){ ","#"!=r[0].charAt(0)&&(e+="if ($"+f+" instanceof CalcError) throw $"+f+"; "),e+="if ("+u(r[1])+") ret.push($"+f+"); ",e+="return ret; ",e+="}.bind(this), []); ",e+=a?"i += "+a+"; ":"i = args.length; ",e+="xargs.push($"+f+")} catch(ex) { if (ex instanceof CalcError) return ex; throw ex; } ",g+="toResolve.push(args.slice(i)); "):"rest"==r?e+="xargs.push(args.slice(i)); i = args.length; ":((p=/^\*/.test(f))&&(w=!0,f=f.substr(1)),e+="var $"+f+" = args[i++]; ",h=!1,/!$/.test(r)?(r=r.substr(0,r.length-1),h=!0):e+="if ($"+f+" instanceof CalcError) return $"+f+"; ",e+=o(r,h)+"xargs.push($"+f+"); ")),e+="} "}function s(){return h?"$"+f:(y=!0,h=!0,g+="toResolve.push(args[i++]); ","($"+f+" = this.force($"+f+"))")}function a(t){return"("+(t?"(typeof "+s()+" == 'number' ? ($"+f+" = round($"+f+"), true) : false) || ":"(typeof "+s()+" == 'number') || ")+"(typeof $"+f+" == 'boolean' ? ($"+f+" = +$"+f+", true) : false) || (typeof $"+f+" == 'string' && !/^(?:=|true|false)/i.test($"+f+") ? (tmp = kendo.spreadsheet.calc.parse(0, 0, 0, $"+f+"), /^date|number|percent$/.test(tmp.type) ? ($"+f+" = +tmp.value, true) : false) : false))"}function o(t,e){h=!1;var r="if (!("+u(t)+")) { ";return h&&!e&&(r+=" if ($"+f+" instanceof CalcError) return $"+f+"; "),r+="return new CalcError(err); } ",h||(g+="i++; "),l+=p?"var $"+f+" = this._arrayArg(args[i]); if ($"+f+") { xargs.push($"+f+"); width = Math.max(width, $"+f+".width); height = Math.max(height, $"+f+".height); arrays.push(true) } else { xargs.push(args[i]); arrays.push(false); } i++; ":"xargs.push(args[i++]); arrays.push(false); ",r}function u(t){if(Array.isArray(t)){if("or"==t[0])return"("+t.slice(1).map(u).join(") || (")+")";if("and"==t[0])return"("+t.slice(1).map(u).join(") && (")+")";if("values"==t[0])return"("+t.slice(1).map(function(t){return s()+" === "+t}).join(") || (")+")";if("null"==t[0])return"("+u("null")+" ? (($"+f+" = "+t[1]+"), true) : false)";if("between"==t[0]||"[between]"==t[0])return"("+s()+" >= "+t[1]+" && $"+f+" <= "+t[2]+" ? true : ((err = 'NUM'), false))";if("(between)"==t[0])return"("+s()+" > "+t[1]+" && $"+f+" < "+t[2]+" ? true : ((err = 'NUM'), false))";if("(between]"==t[0])return"("+s()+" > "+t[1]+" && $"+f+" <= "+t[2]+" ? true : ((err = 'NUM'), false))";if("[between)"==t[0])return"("+s()+" >= "+t[1]+" && $"+f+" < "+t[2]+" ? true : ((err = 'NUM'), false))";if("assert"==t[0]){var e=t[2]||"N/A";return"(("+t[1]+") ? true : (err = "+JSON.stringify(e)+", false))"}if("not"==t[0])return"!("+u(t[1])+")";throw Error("Unknown array type condition: "+t[0])}if("number"==t||"datetime"==t)return a(!0);if("number!"==t)return"(typeof "+s()+" == 'number' ? ($"+f+" = round($"+f+"), true) : false)";if("integer"==t||"date"==t)return"("+a()+" && (($"+f+" |= 0), true))";if("divisor"==t)return"("+a(!0)+" && ($"+f+" == 0 ? ((err = 'DIV/0'), false) : true))";if("number+"==t)return"("+a(!0)+" && ($"+f+" >= 0 ? true : ((err = 'NUM'), false)))";if("integer+"==t)return"("+a()+" && (($"+f+" |= 0) >= 0 ? true : ((err = 'NUM'), false)))";if("number++"==t)return"("+a(!0)+" && ($"+f+" > 0 ? true : ((err = 'NUM'), false)))";if("integer++"==t)return"("+a()+" && (($"+f+" |= 0) > 0 ? true : ((err = 'NUM'), false)))";if("string"==t)return"((typeof "+s()+" == 'string' || typeof $"+f+" == 'boolean' || typeof $"+f+" == 'number') ? ($"+f+" += '', true) : ($"+f+" === undefined ? (($"+f+" = ''), true) : false))";if("boolean"==t)return"(typeof "+s()+" == 'boolean')";if("logical"==t)return"(typeof "+s()+" == 'boolean' || (typeof $"+f+" == 'number' ? ($"+f+" = !!$"+f+", true) : false))";if("matrix"==t)return s(),"((m = this.asMatrix($"+f+")) ? ($"+f+" = m) : false)";if("#matrix"==t)return"((m = this.asMatrix($"+f+")) ? ($"+f+" = m) : false)";if("ref"==t)return"($"+f+" instanceof kendo.spreadsheet.Ref)";if("area"==t)return"($"+f+" instanceof kendo.spreadsheet.CellRef || $"+f+" instanceof kendo.spreadsheet.RangeRef)";if("cell"==t)return"($"+f+" instanceof kendo.spreadsheet.CellRef)";if("null"==t)return"("+s()+" == null)";if("anyvalue"==t)return"("+s()+" != null && i <= args.length)";if("forced"==t)return"("+s()+", i <= args.length)";if("anything"==t)return"(i <= args.length)";if("blank"==t)return"("+s()+" == null || $"+f+" === '')";throw Error("Can't check for type: "+t)}var f,h,c,l="function arrayArgs(args) { var xargs = [], width = 0, height = 0, arrays = [], i = 0; ",g="function resolve(args, callback) { var toResolve = [], i = 0; ",d="'use strict'; function check(args) { var stack = [], tmp, xargs = [], i = 0, m, err = 'VALUE'; ",y=!1,p=!1,w=!1;return d+=r.map(n).join(""),d+="if (i < args.length) return new CalcError('N/A'); ",d+="return xargs; } ",l+="return { args: xargs, width: width, height: height, arrays: arrays }; } ",y?(g+="this.resolveCells(toResolve, callback); } ",c=Function("CalcError","round",d+g+l+" return { resolve: resolve, check: check, arrayArgs: arrayArgs };")):c=Function("CalcError","round",d+" return { check: check };"),c=c(t,i),w||delete c.arrayArgs,c}function i(t){return t===parseInt(t,10)?t:+t.toPrecision(14)}function s(t){return"number"==typeof t?i(t):t}function a(e,r,n){if(n instanceof t)return n;try{return r.apply(e,n)}catch(i){if(i instanceof t)return i;throw i}}function o(t,e,r,n){return function(i,s){function o(){var e,o,u,f,h,c;if(n&&(e=n.call(this,s),s=e.args,e.width>0&&e.height>0)){for(o=new D(this),u=0;u<e.height;++u)for(f=0;f<e.width;++f){for(h=[],c=0;c<s.length;++c)h[c]=e.arrays[c]?s[c].getNA(u,f):s[c];h=r.call(this,h),o.set(u,f,a(this,t,h))}return i(o)}h=r.call(this,s),i(a(this,t,h))}e?e.call(this,s,o):o.call(this)}}function u(e,r,n,i){return function(s,a){function o(){var r,o,u,f,h,c,l,g;if(i&&(r=i.call(this,a),a=r.args,r.width>0&&r.height>0))for(o=new D(this),u=r.width*r.height,f=function(t,e){return function(r){if(o.set(t,e,r),--u,0===u)return s(o)}},h=0;h<r.height&&u>0;++h)for(c=0;c<r.width&&u>0;++c){for(l=[],g=0;g<a.length;++g)l[g]=r.arrays[g]?a[g].getNA(h,c):a[g];if(l=n.call(this,l),l instanceof t){if(o.set(h,c,l),--u,0===u)return s(o)}else l.unshift(f(h,c)),e.apply(this,l)}else r=n.call(this,a),r instanceof t?s(r):(r.unshift(s),e.apply(this,r))}r?r.call(this,a,o):o.call(this)}}function f(t,e){return t=t.toLowerCase(),V[t]=e,{args:function(r,i){var s,a=n(t,r);return i&&(a.arrayArgs&&console.log(""+a.arrayArgs),a.resolve&&console.log(""+a.resolve),a.check&&console.log(""+a.check)),s=V[t]=o(e,a.resolve,a.check,a.arrayArgs),s.kendoSpreadsheetArgs=r,this},argsAsync:function(r,i){var s,a=n(t,r);return i&&(a.arrayArgs&&console.log(""+a.arrayArgs),a.resolve&&console.log(""+a.resolve),a.check&&console.log(""+a.check)),s=V[t]=u(e,a.resolve,a.check,a.arrayArgs),s.kendoSpreadsheetArgs=r,this}}}function h(t,e,r){return e++,(1461*(t+4800+((e-14)/12|0))/4|0)+(367*(e-2-12*((e-14)/12|0))/12|0)-(3*((t+4900+((e-14)/12|0))/100|0)/4|0)+r-32075}function c(t){var e,r,n,i,s,a,o;return e=t+68569,r=4*e/146097|0,e-=(146097*r+3)/4|0,i=4e3*(e+1)/1461001|0,e=e-(1461*i/4|0)+31,n=80*e/2447|0,a=e-(2447*n/80|0),e=n/11|0,s=n+2-12*e,o=100*(r-49)+i+e,s--,{year:o,month:s,date:a,day:(t+1)%7,ord:_[l(o)][s]+a}}function l(t){return t%4?0:t%100?1:t%400?0:1}function g(t){return l(t)?366:365}function d(t,e){return l(t)&&1==e?29:T[e]}function y(t,e,r){return e>=1&&e<=12&&r>=1&&r<=d(t,e-1)}function p(t){return c((0|t)+j)}function w(t,e,r){return h(t,e,r)-j}function v(t){var e,r,n,i,s=t-(0|t);return s<0&&s++,e=Math.round(Y*s),r=Math.floor(e/O),e-=r*O,n=Math.floor(e/I),e-=n*I,i=Math.floor(e/1e3),e-=1e3*i,{hours:r,minutes:n,seconds:i,milliseconds:e}}function m(t){var e=p(t),r=v(t);return new Date(e.year,e.month,e.date,r.hours,r.minutes,r.seconds,r.milliseconds)}function M(t,e,r,n){return(t+(e+(r+n/1e3)/60)/60)/24}function b(t){var e=M(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return t=w(t.getFullYear(),t.getMonth(),t.getDate()),t<0?t-1+e:t+e}function x(t,e){return e&&(e=kendo.spreadsheet.formatting.makeDateFormat(e)),kendo.parseExactDate(t,e)||kendo.parseExactDate(t)||kendo.parseExactDate(t,["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,e){return t="string"==typeof t?t.toLowerCase():t,e="string"==typeof e?e.toLowerCase():e,t===!1&&null==e||(e===!1&&null==t||(0===t&&null==e||(0===e&&null==t||(""===t&&null==e||(""===e&&null==t||t===e)))))}function A(e){return function(r,n){return"string"==typeof r&&"string"!=typeof n&&(n=null==n?"":n+""),"string"!=typeof r&&"string"==typeof n&&(r=null==r?"":r+""),"number"==typeof r&&null==n&&(n=0),"number"==typeof n&&null==r&&(r=0),"string"==typeof r&&"string"==typeof n&&(r=r.toLowerCase(),n=n.toLowerCase()),typeof n==typeof r?e(r,n):new t("VALUE")}}var k,R,C,E,L,N,F,S,D,U,V,j,T,_,I,O,Y,q,J,P,H={},z=kendo.spreadsheet;z.calc=H,k=H.runtime={},R=kendo.Class,C=z.Ref,E=z.CellRef,L=z.RangeRef,N=z.UnionRef,F=z.NULLREF,t.prototype.toString=function(){return"#"+this.code+("NAME"==this.code?"?":"!")},S=R.extend({init:function(t,e,r,n){this.callback=t,this.formula=e,this.ss=r,this.parent=n},resolve:function(t){var e=this;t instanceof C?e.resolveCells([t],function(){e._resolve(t)}):e._resolve(t)},error:function(e){return new t(e)},_resolve:function(t){t=void 0===t?null:Array.isArray(t)?this.asMatrix(t):s(t);var e=this.formula;e.arrayFormulaRange?t=this.asMatrix(t)||this.asMatrix([[t]]):t instanceof L&&(t=this._arrayArg(t)),e.value=t,this.ss.onFormula(e)&&this.callback&&this.callback.call(e,t)},resolveCells:function(t,e){function r(t){t.exec(a.ss,function(){--i||e.call(a)},a)}function n(t){var e,r;for(e=0;e<t.length;++e)r=t[e],r.formula&&o.push(r.formula);return!0}var i,s,a=this,o=[];if(function u(t){var e,r;for(e=0;e<t.length;++e)r=t[e],r instanceof C&&n(a.getRefCells(r)),Array.isArray(r)&&u(r)}(t),!o.length)return e.call(a);for(i=o.length,s=0;s<o.length;++s)r(o[s])},cellValues:function(t,e){var r,n,i=[];for(r=0;r<t.length;++r)n=t[r],n instanceof C?(n=this.getRefData(n,e),i=i.concat(n)):Array.isArray(n)?i=i.concat(this.cellValues(n,e)):n instanceof D?i=i.concat(this.cellValues(n.data,e)):i.push(n);return i},fetchName:function(e,r){var n,i=this.formula,s=this.ss.nameValue(e,i.sheet,i.row,i.col);s instanceof U?(s=s.clone(i.sheet,i.row,i.col,!0),n=new z.ValidationFormulaContext(this.ss.workbook),s.exec(n,r,this)):(s instanceof C&&(s=s.absolute(i.row,i.col),s.sheet||(s.sheet=i.sheet)),r(null==s?new t("NAME"):s))},force:function(t){return t instanceof C?this.getRefData(t):t},func:function(e,r,n){e=e.toLowerCase();var i=V[e];return i?i.call(this,r,n):void r(new t("NAME"))},bool:function(t){return t instanceof C&&(t=this.getRefData(t)),"string"==typeof t?"true"==t.toLowerCase():"number"==typeof t?0!==t:"boolean"==typeof t?t:null!=t},_arrayArg:function(e){var r=this.formula;return!r.arrayFormulaRange&&e instanceof L?1==e.height()&&r.col>=e.topLeft.col&&r.col<=e.bottomRight.col?this.getRefData(new E(e.topLeft.row,r.col).setSheet(e.sheet)):1==e.width()&&r.row>=e.topLeft.row&&r.row<=e.bottomRight.row?this.getRefData(new E(r.row,e.topLeft.col).setSheet(e.sheet)):new t("VALUE"):this.asMatrix(e)},asMatrix:function(t){var e,r,n,i,s,a,o;return t instanceof D?t:(e=this,t instanceof L?(r=t.topLeft,n=r.row,i=r.col,s=e.getRefCells(t),a=new D(e),isFinite(t.width())&&(a.width=t.width()),isFinite(t.height())&&(a.height=t.height()),isFinite(n)||(n=0),isFinite(i)||(i=0),s.forEach(function(t){a.set(t.row-n,t.col-i,t.value)}),a):Array.isArray(t)&&t.length>0?(a=new D(e),o=0,t.forEach(function(t){var r=0,n=1;t.forEach(function(t){var i=t instanceof L;t instanceof C&&!i&&(t=e.getRefData(t)),(i||Array.isArray(t))&&(t=e.asMatrix(t)),t instanceof D?(t.each(function(t,e,n){a.set(o+e,r+n,t)}),n=Math.max(n,t.height),r+=t.width):("string"==typeof t&&t.length&&!isNaN(t)&&(t=+t),a.set(o,r++,t))}),o+=n}),a):void 0)},getRefCells:function(t,e,r){var n=this.formula;return this.ss.getRefCells(t,e,n.sheet,n.row,n.col,r)},getRefData:function(t,e){var r=this.formula;return this.ss.getData(t,r.sheet,r.row,r.col,e)},workbook:function(){return this.ss.workbook}}),D=R.extend({init:function(t){this.context=t,this.height=0,this.width=0,this.data=[]},clone:function(){var t=new D(this.context);return t.height=this.height,t.width=this.width,t.data=this.data.map(function(t){return t.slice()}),t},get:function(t,e){var r=this.data[t],n=r?r[e]:null;return n instanceof C?this.context.getRefData(n):n},getNA:function(e,r){return e<this.height&&r<this.width?this.get(e,r):new t("N/A")},set:function(t,e,r){var n=this.data[t];null==n&&(n=this.data[t]=[]),n[e]=r,t>=this.height&&(this.height=t+1),e>=this.width&&(this.width=e+1)},each:function(t,e){var r,n,i;for(r=0;r<this.height;++r)for(n=0;n<this.width;++n)if(i=this.get(r,n),(e||null!=i)&&(i=t.call(this.context,i,r,n),void 0!==i))return i},map:function(t,e){var r=new D(this.context);return this.each(function(e,n,i){r.set(n,i,t.call(this,e,n,i))},e),r},eachRow:function(t){var e,r;for(e=0;e<this.height;++e)if(r=t.call(this.context,e),void 0!==r)return r},eachCol:function(t){var e,r;for(e=0;e<this.width;++e)if(r=t.call(this.context,e),void 0!==r)return r},mapRow:function(t){var e=new D(this.context);return this.eachRow(function(r){e.set(r,0,t.call(this.context,r))}),e},mapCol:function(t){var e=new D(this.context);return this.eachCol(function(r){e.set(0,r,t.call(this.context,r))}),e},toString:function(){return JSON.stringify(this.data)},transpose:function(){var t=new D(this.context);return this.each(function(e,r,n){t.set(n,r,e)}),t},unit:function(t){var e,r,n,i;for(this.width=this.height=t,e=this.data=Array(t),r=t;--r>=0;)for(n=e[r]=Array(t),i=t;--i>=0;)n[i]=r==i?1:0;return this},multiply:function(e){var r,n,i,s,a,o,u=this,f=new D(u.context);for(r=0;r<u.height;++r)for(n=0;n<e.width;++n){for(i=0,s=0;s<u.width;++s){if(a=u.get(r,s),o=e.get(s,n),"number"!=typeof a||"number"!=typeof o)throw new t("VALUE");i+=a*o}f.set(r,n,i)}return f},adds:function(t,e){var r,n,i,s,a=this,o=new D(a.context),u=e?-1:1;for(r=0;r<a.height;++r)for(n=0;n<a.width;++n)i=a.get(r,n),s=t.get(r,n),o.set(r,n,i+u*s);return o},determinant:function(){var t,e,r,n,i,s=this.clone().data,a=s.length,o=1;for(t=0;t<a;t++){for(e=t;e<a&&!s[e][t];e++);if(e==a)return 0;if(e!=t)for(o=-o,n=t;n<a;n++)i=s[t][n],s[t][n]=s[e][n],s[e][n]=i;for(r=t+1;r<a;r++)for(n=t+1;n<a;n++)s[r][n]-=s[t][n]*s[r][t]/s[t][t];o*=s[t][t]}return o},inverse:function(){var t,r,n,i,s,a,o=this.width,u=this.augment(new D(this.context).unit(o)),f=u.data;for(r=0;r<o;++r){if(n=e(r,o,function(t){return f[t][r]}),!f[n][r])return null;for(r!=n&&(t=f[r],f[r]=f[n],f[n]=t),i=r+1;i<o;++i){for(s=r+1;s<2*o;++s)f[i][s]-=f[r][s]*f[i][r]/f[r][r];f[i][r]=0}}for(i=0;i<o;++i)for(a=f[i][i],s=0;s<2*o;++s)f[i][s]/=a;for(r=o;--r>=0;)for(i=r;--i>=0;)if(f[i][r])for(s=2*o;--s>=o;)f[i][s]-=f[r][s]*f[i][r];return u.slice(0,o,o,o)},augment:function(t){var e=this.clone(),r=e.width;return t.each(function(t,n,i){e.set(n,i+r,t)}),e},slice:function(t,e,r,n){var i,s,a=new D(this.context);for(i=0;i<r;++i)for(s=0;s<n;++s)a.set(i,s,this.get(t+i,e+s));return a}}),U=R.extend({init:function(t,e,r,n,i,s,a){this.refs=t,this.handler=e,this.print=r,this.absrefs=null,this.sheet=n,this.row=i,this.col=s,this.onReady=[],this.pending=!1,this.arrayFormulaRange=a},setArrayFormulaRange:function(t){this.arrayFormulaRange=t.clone().setSheet(this.sheet)},clone:function(t,e,r,n){var i=t.toLowerCase(),s=this.refs,a=this.arrayFormulaRange;return(n||i!=this.sheet.toLowerCase())&&(s=s.map(function(e){return e.hasSheet()||e.sheet&&e.sheet.toLowerCase()==i||(e=e.clone().setSheet(t)),e}),a&&(a=a.clone().setSheet(t))),new U(s,this.handler,this.print,t,e,r,a)},deepClone:function(){var t=this.refs.map(function(t){return t.clone()});return new U(t,this.handler,this.print,this.sheet,this.row,this.col,this.arrayFormulaRange)},resolve:function(t){this.pending=!1,this.onReady.forEach(function(e){e(t)})},exec:function(e,r,n){var i,s,a;if("value"in this)r&&r(this.value);else{for(r&&this.onReady.push(r),i=new S(this.resolve,this,e,n),s=0;n;){if(n.formula===this)return this.pending=!1,void i.resolve(new t("CIRCULAR"));n=n.parent,++s}if(this.pending)return;this.pending=!0,a=function(){this.absrefs||(this.absrefs=this.refs.map(function(t){return t.absolute(this.row,this.col)},this)),this.handler.call(i)}.bind(this),s<20?a():setTimeout(a,0)}},reset:function(){this.onReady=[],this.pending=!1,delete this.value},renameSheet:function(t,e){t=t.toLowerCase(),this.absrefs=null,this.sheet.toLowerCase()==t&&(this.sheet=e),this.refs.forEach(function(r){r.renameSheet(t,e)})},adjust:function(t,e,n,i){function s(r){return r===F?r:r.sheet.toLowerCase()!=t?(f&&("row"==e&&a>=n&&(r=r.relative(i,0)),"col"==e&&o>=n&&(r=r.relative(0,i))),r):r.adjust(a,o,h,c,"row"==e,n,i)}var a,o,u,f,h,c,l,g,d;if(t=t.toLowerCase(),a=this.row,o=this.col,u=this.sheet.toLowerCase(),f=!1,u==t&&("row"==e&&a>=n&&(this.row+=i,f=!0),"col"==e&&o>=n&&(this.col+=i,f=!0)),h=this.row,c=this.col,this.absrefs=null,l=this.refs,g=f,this.refs=l.map(function(t){var e=s(t);return g||r(e,t)||(g=!0),e}),d=this.arrayFormulaRange,d&&(this.arrayFormulaRange=s(d),g||r(d,this.arrayFormulaRange)||(g=!0)),g)return new U(l,this.handler,this.print,this.sheet,a,o,d)},toString:function(){return this.print(this.row,this.col)}}),V=Object.create(null),V["if"]=function(e,r){var n=this,i=r[0],s=r[1],a=r[2];this.resolveCells([i],function(){var r=n.asMatrix(i);r?s(function(i){a(function(s){var a=n.asMatrix(i),o=n.asMatrix(s);e(r.map(function(e,r,u){return e instanceof t?e:n.bool(e)?a?a.get(r,u):i:o?o.get(r,u):s}))})}):(i=this.force(i),i instanceof t?e(i):n.bool(i)?s(e):a(e))})},V["φ"]=function(t){t((1+Math.sqrt(5))/2)},j=h(1900,0,-1),T=[31,28,31,30,31,30,31,31,30,31,30,31],_=[[0,31,59,90,120,151,181,212,243,273,304,334],[0,31,60,91,121,152,182,213,244,274,305,335]],I=6e4,O=60*I,Y=24*O,k.CalcError=t,k.Formula=U,k.Matrix=D,k.packDate=w,k.unpackDate=p,k.packTime=M,k.unpackTime=v,k.serialToDate=m,k.dateToSerial=b,k.daysInMonth=d,k.validDate=y,k.isLeapYear=l,k.daysInYear=g,k.parseDate=x,k.limitPrecision=i,z.dateToNumber=b,z.numberToDate=m,z.defineFunction=f,z.CalcError=t,k.defineFunction=f,k.defineAlias=function(t,e){var r=V[e];if(!r)throw Error("Function "+e+" is not yet defined");r.kendoSpreadsheetAliases||(r.kendoSpreadsheetAliases=[e]),r.kendoSpreadsheetAliases.push(t),V[t]=r},k.FUNCS=V,q=["or","number",["null",0]],J=[["*a",q],["*b",q]],P=[["*a","forced"],["*b","forced"]],f("binary+",function(t,e){return t+e}).args(J),f("binary-",function(t,e){return t-e}).args(J),f("binary*",function(t,e){return t*e}).args(J),f("binary/",function(t,e){return t/e}).args([["*a",q],["*b","divisor"]]),f("binary^",function(t,e){return Math.pow(t,e)}).args(J),f("binary&",function(t,e){return null==t&&(t=""),null==e&&(e=""),""+t+e}).args([["*a",["or","number","string","boolean","null"]],["*b",["or","number","string","boolean","null"]]]),f("binary=",$).args(P),f("binary<>",function(t,e){return!$(t,e)}).args(P),f("binary<",A(function(t,e){return t<e})).args(P),f("binary<=",A(function(t,e){return t<=e})).args(P),f("binary>",A(function(t,e){return t>e})).args(P),f("binary>=",A(function(t,e){return t>=e})).args(P),f("unary+",function(t){return t}).args([["*a",q]]),f("unary-",function(t){return-t}).args([["*a",q]]),f("unary%",function(t){return t/100}).args([["*a",q]]),f("binary:",function(t,e){return new L(t,e).setSheet(t.sheet||this.formula.sheet,t.hasSheet())}).args([["a","cell"],["b","cell"]]),f("binary,",function(t,e){return new N([t,e])}).args([["a","ref"],["b","ref"]]),f("binary ",function(t,e){return t.intersect(e)}).args([["a","ref"],["b","ref"]]),f("not",function(t){return!this.bool(t)}).args([["*a",["or","anyvalue",["null",0]]]]),f("isblank",function(t){return t instanceof E&&(t=this.getRefData(t),null==t)}).args([["*value","anything!"]]),f("iserror",function(e){return e instanceof t}).args([["*value","forced!"]]),f("iserr",function(e){return e instanceof t&&"N/A"!=e.code}).args([["*value","forced!"]]),f("isna",function(e){return e instanceof t&&"N/A"==e.code}).args([["*value","forced!"]]),f("islogical",function(t){return"boolean"==typeof t}).args([["*value","forced!"]]),f("isnontext",function(t){return"string"!=typeof t}).args([["*value","forced!"]]),f("istext",function(t){return"string"==typeof t}).args([["*value","forced!"]]),f("isnumber",function(t){return"number"==typeof t}).args([["*value","forced!"]]),f("isref",function(t){return t instanceof E||t instanceof L}).args([["*value","anything!"]]),V[",getname"]=function(t,e){this.fetchName(e[0],t)}},r(3))}});